-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Major modifications to simplify usage and fix various issues with shape analysis #2200
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jcohenadad
added
enhancement
category: improves performance/results of an existing feature
sct_process_segmentation
context:
labels
Mar 18, 2019
shape is now computing slicewise, by stretching the image using the angle between the centerline and the normal to the 2D patch plane. Partly fixes #1395
Making msct_shape.py obsolete
A few fixes needed
for consistency with angle_AP. Same with RL.
Fixed abnormal "Weights sum to zero, can't be normalized" in aggregate_slicewise(). Fixes #2203
Was causing wrong estimation of CSA. Test should be made more sensitive
charleygros
approved these changes
Mar 28, 2019
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.
Tested on one data, works well!
- Believe that's relevant to remove the flag -p --> will make the utilisation of this function more intuitive.
- Really like the idea of creating the file 'create_test_data.py', makes complete sense to me.
Thank you!!
with int16 input, transform.warp() stretch instead of compress the image. Now converting to float64 to make sure this does not happen. Added tests to cover these cases.
jcohenadad
added a commit
that referenced
this pull request
Dec 18, 2019
…pe analysis (#2200) * test_process_seg: Re-activated shape analysis with angled seg * msct_shape: First step of major refactoring for computing shape shape is now computing slicewise, by stretching the image using the angle between the centerline and the normal to the 2D patch plane. Partly fixes #1395 * process_seg: Moved msct_shape --> process_seg Making msct_shape.py obsolete * process_seg: new implementation of shape analysis now working A few fixes needed * process_seg: Added angle_RL and angle_AP as output * process_seg: Renamed dict field AP_diameter --> diameter_AP for consistency with angle_AP. Same with RL. * process_seg: Cleanup * process_seg: Upsample image to increase precision in shape analysis * process_seg: Added progress bar * unit_testing/create_test_data: New file to create testing data * test_centerline: Refactored to use create_test_data.py * test_centerline.py: Cleanup * test_centerline: Cleanup * test_process_seg: Refactoring with parametrized dummy seg (WIP) * process_seg.py: Added angle_correction * process_seg.py: Fixed index bug * create_test_data.py: Added size_arr flag and updated test_process_seg Tests now pass * create_test_data.py: Added proper file name for saving in debug * centerline/core.py: Cleanup * centerline/core.py: Fixed indexation bug * test_centerline.py: Now testing for case with minmax=True * process_seg.py: Few fixes and test added regarding angle correction * test_process_seg.py: Compressed code * create_test_data.py: Added comments * create_test_data.py: Now possible to specify pixdim * create_test_data.py: Added IS angle for test data generation * test_process_seg.py: Merged with/without angle test functions * test_process_seg.py: Cleanup * create_test_data.py: Now using resampling to fit desired pixdim Because creating nii object after rotation created problems of scaling * test_process_seg.py: Finalized testing * create_test_data,test_process_seg: Renamed variable for clarity * create_test_data,test_process_seg: Added flag to empty specific slice * process_seg: Fixed bug in case empty slice * test_process_seg: Now testing if empty slice * process_seg.py: Removed compute_csa (replaced by compute_shape) * process_seg.py: Renamed functions with suffix _ * process_seg: Crop 2d patch before upsampling for faster execution * create_test_data: Removed saving (used for debug) * test_process_seg: Increased precision of test with ground truth * sct_process_segmentation: Updated to reflect changes in process_seg * msct_shape.py: Removed useless file, replaced by process_seg * test_deepseg_sc.py: Fixed regression with new create_test_data * batch_processing.sh: Updated to reflect changes in process_seg * sct_process_segmentation.py: Output name shape.csv --> csa.csv * sct_process_segmentation.py: Cleanup doc * batch_processing.sh: Fixed index issue on csv reading * process_seg.py: Fixed logging output * process_seg.py: Normalize image before binarizing in case it is float * resampling/resample_nipy(): Enabled to specify dtype of output * create_test_data,test_process_seg: Now testing for np.uint8 input * process_seg.py: Cleanup imports * create_test_data.py: Removed debug mode (saving) * aggregate_slicewise.py: Fixed issue for when input mask is empty Fixed abnormal "Weights sum to zero, can't be normalized" in aggregate_slicewise(). Fixes #2203 * process_seg.py: Check if slice is empty before doing normalization * process_seg.py: Updated docstring * aggregate_slicewise.py: Fixed bug when summing array with dim>1 * aggregate_slicewise.py: Updated dict field for process_seg * process_seg.py: Cleanup * process_seg.py: Fixed mixup between X and Y for applying affine T Was causing wrong estimation of CSA. Test should be made more sensitive * process_seg.py: Forgot to update variable name * test_process_seg: Added test for fixing orientation * process_seg: Fixed bug when finding orientation * process_seg.py: Fixed bug related to orientation, improve test * test_process_seg: Added test for negative angled cord * process_seg: Reduced oversampling factor for faster execution * create_test_data: Added debug mode and possibility to change orientation * process_seg: Fixed bug related to array format with int16 input, transform.warp() stretch instead of compress the image. Now converting to float64 to make sure this does not happen. Added tests to cover these cases. * test_process_seg: Added tests for array format * sct_utils: Added function to display platform-compatible open syntax * sct_process_segmentation: Added platform-compatible syntax to open csv * sct_extract_metric: Added platform-compatible syntax to open csv Former-commit-id: 08bc024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
category: improves performance/results of an existing feature
sct_process_segmentation
context:
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.
These major modifications of
sct_process_segmentation
include:ratio_minor_major
because redundant withAP_diameter
+RL_diameter
-p
and always output csa results along with shape analysisNotable changes in API
-p
to select csa from shape, because shape analysis is now run by default for the function (and includes csa measure).-no-angle
-->-angle-corr
, which is more intuitiveResults of batch_processing
jca/1395-process-seg-shape db78f71
master 0b3d3c5