Update to 1.9.0, also Fix ROI orientation, especially 4D #1494
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.