New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed aberrant mtr values #2503
Conversation
Otherwise new function in qmri/mt is failing
@@ -13,16 +13,41 @@ | |||
logger = logging.getLogger(__name__) | |||
|
|||
|
|||
def compute_mtr(nii_mt1, nii_mt0): | |||
def divide_after_removing_zero(dividend, divisor, threshold, replacement=np.nan): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GReat!
type=float, | ||
help="Threshold to clip MTR output values in case of division by small number. This threshold is applied on the" | ||
"absolute value. Default: 100.", | ||
default=100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So values will be between -100 and 100, is it right? or am I misunderstanding?
If so, could it be helpful to mention this in the help?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed-- clarified in 509c99b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great!
* sct_compute_mtr: Force saving as float64 * sct_compute_mtr: Changed dtype output to float32 (enough) * image: Fixed bug where dtype was not set in the nibabel hdr * qmri/mt: Created function divide_after_removing_zero() * qmri/mt: Fixed dtype bug * test_qmri: Now testing with input array Otherwise new function in qmri/mt is failing * image: Fixed bug when using SCT-specific dtype 'minimize' * sct_compute_mtr: Added param -thr * sct_compute_mtr: now showing logger and SCT version info on run * qmri/mt: Adding verbose about clipping, nan replacement * Clarified threshold range in help Former-commit-id: 7b2e5a195cb355a5080d8eff4327a5c22846c770 [formerly 6c4643d [formerly ccfd787]] Former-commit-id: b4636e6ad64fd615afc09c4fe796bb84ad1f0593 Former-commit-id: 0b5efe5
* sct_compute_mtr: Force saving as float64 * sct_compute_mtr: Changed dtype output to float32 (enough) * image: Fixed bug where dtype was not set in the nibabel hdr * qmri/mt: Created function divide_after_removing_zero() * qmri/mt: Fixed dtype bug * test_qmri: Now testing with input array Otherwise new function in qmri/mt is failing * image: Fixed bug when using SCT-specific dtype 'minimize' * sct_compute_mtr: Added param -thr * sct_compute_mtr: now showing logger and SCT version info on run * qmri/mt: Adding verbose about clipping, nan replacement * Clarified threshold range in help Former-commit-id: ccfd787
A combination of issues yielded aberrant MTR values as the output of
sct_compute_mtr
:This PR fixes it by:
-thr
Fixes #2501