Comments (5)
Most likely incorrect test:
if(
(
(
(!qcResult.Get_result() & InterlaceWiseCheckBit) == InterlaceWiseCheckBit
)
||
(
!(
this->GetProtocol().GetSliceCheckProtocol().bQuitOnCheckFailure ||
this->GetProtocol().GetInterlaceCheckProtocol().bQuitOnCheckFailure
)
)
)
&& this->GetProtocol().GetGradientCheckProtocol().bCheck
)
vs
similar but most likely correct test
if(
(
(
!(
(qcResult.Get_result() & InterlaceWiseCheckBit) == InterlaceWiseCheckBit
)
)
||
(!
(
this->GetProtocol().GetSliceCheckProtocol().bQuitOnCheckFailure ||
this->GetProtocol().GetInterlaceCheckProtocol().bQuitOnCheckFailure
)
)
)
)
from dtiprep.
Then, based on my previous comment I think the correct test should be:
if(
(
!( // <------- Logical not moved outside
(qcResult.Get_result() & InterlaceWiseCheckBit) == InterlaceWiseCheckBit
)
||
(
!(
this->GetProtocol().GetSliceCheckProtocol().bQuitOnCheckFailure ||
this->GetProtocol().GetInterlaceCheckProtocol().bQuitOnCheckFailure
)
)
)
&& this->GetProtocol().GetGradientCheckProtocol().bCheck
)
from dtiprep.
Which in turn can be rewritten as this more readable version:
bool doInterlaceWiseCheck = (qcResult.Get_result() & InterlaceWiseCheckBit) == InterlaceWiseCheckBit;
bool doQuitOnCheckFailure =
this->GetProtocol().GetSliceCheckProtocol().bQuitOnCheckFailure ||
this->GetProtocol().GetInterlaceCheckProtocol().bQuitOnCheckFailure;
if(
( !doInterlaceWiseCheck || !doQuitOnCheckFailure )
&& this->GetProtocol().GetGradientCheckProtocol().bCheck
)
{
// ...
}
from dtiprep.
Thanks JC, I think you are correct. DTIPrep has (in parts) some really ugly code (2 postdocs who weren't the best coders worked on it), sorry!
from dtiprep.
Hi @styner ,
No need to be sorry. It is nature of the work.
Improving our processes, providing education and resources to increase quality of our softwares, and also including software maintenance in our grants and funding requests are all helpful actions 😄
The code being open-source with a permissive license, and available on GitHub with the option of doing pull requests is one of the many steps in the right direction.
I think some of the take home messages would be:
- to care for build warnings and try to either address them or explicitly disable them. They often reveals useful information.
- add tests
Thanks again for reviewing and integrating these changes.
Jc
from dtiprep.
Related Issues (20)
- Feature request: Adding command line mode for creating protocol and setting options of protocol
- Errant DWICount, BaselineCount values in InterlaceChecker
- please clarify license on included components HOT 3
- Build Slicer Extension
- FAILED execution of DTIPrep with cryptic error code HOT 5
- Gradient is not excluded in the final report _XMLQCResult.xml
- Run time error of DTIPrep because of a missed shared library HOT 9
- Gradients excluded during Interlace Check though thresholds not exceeded HOT 1
- Additional minimal threshold on slice wise check
- Image_origin_check FAILED
- bug in contrast adjustment in DTIPrep1.2.6
- Test data
- command line mode does not replace gradient info
- precision reporting wrong HOT 3
- Baseline averaging information wrong in result xml
- Baseline detection needs a tolerance that should be adjustable in protocol HOT 1
- DTIPrep data type output HOT 1
- Baseline averaging file writeout error
- Associate 3d-slicer-extension topic with the repository HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dtiprep.