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
GUI bug fixes and new GUI buttons #358
Conversation
Thanks @tanguyduval ! As for the NaN in masks, I'm worried about automatically setting values to 0; it removes some UI feedback telling us that there might be something wrong in the dataset (if there are NaNs in masks, I suspect that there is...). Also, QSM is very sensitive to the quality of the brain mask, and the algorithm could break under some circumstances if datapoints in the masks are not connected. Maybe an alternative could be a popup appearing while initially loading the masked data, notifying the user about the issues in the mask data ("FYI: there are some points in the mask that are NaN. What do you want us to do with them ? (1) ignore (2) set to 0 (3) set to 1). What do you think? |
I think those values can be set to zero and a xxx_nan_mask binary image can be exported to inform the user about which values were changed from NaN --> 0. |
src/Common/FitData.m
Outdated
@@ -77,6 +77,7 @@ | |||
|
|||
% Find voxels that are not empty | |||
if isfield(data,'Mask') && (~isempty(data.Mask)) | |||
data.Mask(isnan(data.Mask))=0; |
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.
This seems quite reasonable to me. Would saving isnan(data.Mask)
output be extra?
I agree that they are "dangerous", but I'm afraid that automatically handling this might then create some issues long term if we don't inform the user that there was NaN in the masks. The dangerous thing was that they made a mistake in creating the mask in the first place (NaN should not have been there at all, so what else went wrong before) ! Automatically setting to 0 could cause some issues, like in QSM, where I could see some problems with the deconvolution if there are a lot of sparse 0 in the brain because some NaN appeared there. QSM is extremely sensitive to boundary conditions, and so I could envision a situation where someone complains that their QSM processed maps are aweful, but everything looks fine, and it's because we automatically set the NaNs in the brain to 0. I will be very hard to debug/discover, if we dont at a bare minimum inform the user that NaNs in the data exists, and what we did about it. For example, using a popup. |
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.
Add functionality that informs user that NaNs in the data exists, and how we tried to resolve it.
@mathieuboudreau I'd say we avoid pop-up, carry on with processing by NaN --> 0 but report/log it. |
@mathieuboudreau @agahkarakuzu I propose to use the input |
@tanguyduval for non-voxelwise models this is not taking effect. I tired it with Should we include this in |
@agahkarakuzu good catch. Solved in a3c1eb4 |
I pushed a small commit to show warning only when NaN exists and also add this check to the voxelwise as well. Checked functionality with @mathieuboudreau quick question, can you fit |
Oups... my mistake
I think you have duplicated the check for voxelwise... the first check is already before the condition
|
Looks like PR #355 caused a lot of issues, there was the NaN issue that a user reported in #357, but @TommyBoshkovski let me know today that a lot of our models were also broken due to a similar issue (but not displaying the same error). I also discovered a completely different bug that happened for b1_dam, which I fixed in 7316f4d. This makes me suspect that there might be some more lingering around, so please be vigilant and report any GUI-related oddities if you encounter them; I had tested the GUI while reviewing #355, but only for one model (VFA), which worked fine. I think it may be overkill to test all models at every PR, so I won't update the checklist, but if ever any of you review a PR that specifically deals with the GUI backend (like imtools), then I think it may be prudent to do a more thorough review. |
@tanguyduval is this branch ready to be merged, or do you have more local changes to push? |
@mathieuboudreau this branch can be merged (and should be merged ASAP). I solved the problem of NaN at periphery here: 83d1b69 |
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.
Approved after further testing & bug fixes.
@tanguyduval I saw that commit about the NaNs at periphery, but don't fully understand what the issue was by reading the thread here. Can you expand on it? I think Travis didn't catch these errors as most appear to deal with some GUI & data relationships, so maybe the CLI don't call the same tools during the tests. |
Thanks for all the help @tanguyduval ! |
@mathieuboudreau nii_xform, in addition to loading files, applies an affine transform to match the reference. The interpolation that applies during the transformation introduce NaNs at periphery. In qMRLab, we load each file independently (the reference was the same file that the one that was loaded). I modified the loading function to just load and skip the affine transform in this case. And you are right, the CLI don't call this part... |
Great, thanks for clarifying! |
Purpose
[BUG] Solve #357
[NEW] bvec and bval files can be loaded for Diffusion protocols (need
DiffusionData
in Model.MRIinputs). Now any diffusion dataset with .bvec and .bval files can be loaded easily in qMRLab[NEW] Create button for protocol (e.g. linspace)
[NEW]
Default
button in the option panel can reset the protocolApproach
Concerning #357 I just set NaN values to 0
Open Questions and Pre-Merge TODOs
Use github checklists. When solved, check the box and explain the answer.
Review that changed source files/lines are related to the pull request/issue
If any files/commits were accidentally included, cherry-pick them into another branch.
Review that changed source files/lines were not accidentally deleted
Fix appropriately if so.
Test new features or bug fix
If not implemented/resolved adequately, solve it or inform the developer by requesting changes in your review.
Preferably, set breakpoints in the locations that the code was changed and follow allong line by line to see if the code behaves as intended.
Manual GUI tests (general)
Specifications