Skip to content
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

Update to 1.9.0, also Fix ROI orientation, especially 4D #1494

Merged

Conversation

AlexanderGetka-cbica
Copy link
Contributor

@AlexanderGetka-cbica AlexanderGetka-cbica commented May 27, 2022

Updates to 1.9.0 as well to avoid needing multiple PRs.

ROIs were failing to load properly under certain conditions due to how images get reoriented for display and the incomplete tracking of original direction. This has been fixed in this PR. Now images/ROIs get reoriented into a common orientation when loaded into the viewer and reoriented back when saved -- so the ROI/Images will now render properly when loaded into, say, ITK-snap.

Basically, this fixes ROI and image orientation so that we properly track original orientation/direction/origin at load time and go back when saving under all conditions. Before this fix, ROIs were being saved with the "correct" directionality/orientation (the same as the image that was loaded), but the actual ROI data would not be aligned with this. So you'd get odd behavior like drawing on the image, saving it and reloading it to find that it was flipped. And when this wasn't tracked properly for 4D images, we ended up with a scenario where moving the 4D slider generated a change in the mask directionality.

This also prevents a crash from occurring when trying to save 4D images, but does not yet implement it (since it's not that useful -- we don't have anything that produces new 4D images right now, anyway). It also fixes a bug where certain ImageSanityChecks would fail between otherwise valid 4D and 3D images, and where mask saving/loading would sometimes fail for 2D images.

Relevant code is in fMainWindow.cpp, SlicerManager.cpp, and cbicaITKUtilities.cpp.

@AlexanderGetka-cbica AlexanderGetka-cbica changed the title Fix ROI orientation, especially 4D Update to 1.9.0, also Fix ROI orientation, especially 4D May 27, 2022
Copy link
Contributor

@sarthakpati sarthakpati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs some edits and clarification.

src/view/gui/SlicerManager.cpp Outdated Show resolved Hide resolved
src/view/gui/SlicerManager.cpp Outdated Show resolved Hide resolved
src/view/gui/fMainWindow.cpp Outdated Show resolved Hide resolved
@AlexanderGetka-cbica
Copy link
Contributor Author

@sarthakpati The above comments are resolved. Thanks!

Copy link
Contributor

@sarthakpati sarthakpati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@AlexanderGetka-cbica AlexanderGetka-cbica merged commit cce8818 into CBICA:master May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants