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

Removed support for -initc2 flag because there is an alternative approach with sct_label_utils #2125

Merged
merged 1 commit into from
Jan 19, 2019

Conversation

jcohenadad
Copy link
Member

Instead, user can create a label with sct_label_utils and then run sct_label_vertebrae with flag -initlabel. This decision enables to lighter the code and minimize the number of choices for the user (could be overwhelming).

Example:

sct_label_utils -i t2.nii.gz -create-viewer 3 -o label_c2c3.nii.gz -msg "Click at the posterior tip of C2/C3 inter-vertebral disc"
sct_label_vertebrae -i t2.nii.gz -s t2_seg.nii.gz -c t2 -initlabel label_c2c3.nii.gz -qc ~/qc_singleSubj

Fixes #2120

@jcohenadad jcohenadad added enhancement category: improves performance/results of an existing feature sct_label_vertebrae context: labels Jan 19, 2019
@jcohenadad jcohenadad added this to the v4.0.0 milestone Jan 19, 2019
@jcohenadad jcohenadad added the compatibility Incompatible API changes that necessitate a MAJOR version bump. Refer to https://semver.org/ label Jan 19, 2019
@jcohenadad jcohenadad changed the title sct_label_vertebrae: Removed support for initc2 Removed support for -initc2 flag Jan 19, 2019
@jcohenadad jcohenadad changed the title Removed support for -initc2 flag Removed support for -initc2 flag because there is an alternative approach with sct_label_utils Jan 19, 2019
@jcohenadad jcohenadad merged commit fe30f1b into master Jan 19, 2019
@jcohenadad jcohenadad deleted the jca/2120-label-vertebrae-initc2 branch January 19, 2019 14:44
jcohenadad pushed a commit that referenced this pull request Jan 19, 2019
* detect_c2c3: improvements -- postprocessing

* keep clusters with correct margin

* use normalised margin

* use top of the segmentation as anatomical prior

* dev/detect_c2c3/train: create qc, nb of sagittal slices avg

* spinalcordtoolbox/vertebrae/detect_c2c3: avg 7 sag slices, remove hard coded post processing

* Update README.md (#2118)

* Expose aggregate_slicewise() API and various improvements (#2115)

* sct_extract_metric: Created API: extract_metric

* sct_extract_metric: Started refactoring to use aggregate_slicewise

* aggregate_slicewise: Started refactoring for accommodating extract_metric

- metrics is now ndarray (instead of list) to deal with >1 dim
- added mask for computing weighted average, ml, etc.

* sct_extract_metric,aggregate_slicewise: Main steps of working API

sct_extract_metric now working (in specific scenario) with new APIs.

* aggregate_slicewise,sct_extract_metric: Further improvements
- Moved Metric() class inside aggregate_slicewise
- Now display Mask in output csv
- Now display func with metric name (for compatibility with process_seg module)

* aggregate_slicewise: Changed variable name

* process_seg: Adapted code to fit recent changes in aggregate_slicewise

* msct_shape,process_seg: Adapted code to fit changes in aggregate_slicewise

Other modifications:
- drop features: incremental_length, distance_from_C1, vertebral_level

* test_process_seg: Fixed broken compatibility with recent changes

* sct_extract_metric,aggregate_slicewise: Refactored to generalize for ML and WA

Notably introduced label_struc Class inside sct_extract_metric for simplicity

* sct_extract_metric,aggregate_slicewise: Moved extract_metric inside aggregate_slicewise

Will enable unit testing

* aggregate_slicewise: Generalized to n-dim

was breaking compatibility with process_seg

* test_aggregate_slicewise: Started to update tests with recent changes

* aggregate_slicewise: Generalized to n-dim, added tests

* test_aggregate_slicewise: All tests pass

* test_aggregate_slicewise: Added test for csv

Testing output of extract_metric()
Also fixed few issues in aggregate_slicewise.py

* aggregate_slicewise: Fixed ordering of column in output csv

All tests pass

* aggregate_slicewise: Fixed issue with STD and ML method

* aggregate_slicewise: Changed the way errors are raised

* sct_extract_metric: Added field for appending to csv

* utils: Fixed bug in parse_num_list_inv()

Number of chars to adapt based on int

* aggregate_slicewise: Implemented method=bin and added test

* sct_extract_metric: Dropped support for method=wath

Not really used...

* aggregate_slicewise: Implemented method=max

And associated tests and wrapper

* sct_process_segmentation: Fixed broken compatibility

* msct_shape: Fixed bug when looping across slices

* sct_extract_metric: Fixed undeclared variable

* aggregate_slicewise: Removed weight in ML for faster estimate

Also started to implement MAP

* sct_extract_metric: Changed default value for perslice

* aggregate_slicewise: Implemented MAP (unfinished)

need to pass ml_clusters information to func_ml()

* aggregate_slicewise: Refactored for compatibility with MAP

* aggregate_slicewise: Fixed bug related to reshaping mask

Also added MAX in csv output

* aggregate_slicewise: Fixed wrong indentation for try/except

* aggregate_slicewise: Fixed duplicated dict key

* aggregate_slicewise: Added check for non-finite values

* test_sct_extract_metric: Updated test

* aggregate_slicewise: Fixed bug introduced with checking for nonfinite

* aggregate_slicewise: Fixed wrong reshape of array

* batch_processing: Update with recent modifs in API

* aggregate_slicewise,sct_process_segmentation: Added TODO

* sct_process_segmentation,aggregate_slicewise: Changed default

Regarding perslice and perlevel. To be closer to previous behaviour.

* template: Now checking for inf in get_slices_from_vertebral_levels

* sct_extract_metric: Few improvements

- Display output file
- Fixed default params

* aggregate_slicewise: Created merge_dict() to deal with dict of dict

Useful for sct_process_seg with several output metrics, to be able to concatenate them in a single csv

* sct_process_segmentation: Now output all metrics in the same csv

There's still a bug to solve in merge_dict()

* aggregate_slicewise: Fixed small bug in merge_dict

* aggregate_slicewise: Now ordering metrics in a friendly way

* test_aggregate_slicewise: Fixed bug caused by recent changes

* aggregate_slicewise: Forgot to add CSA and Angle

* batch_processing: Updated to match recent changes

* sct_extract_metric: Fixed deprecated default method wath

* test_sct_extract_metric: Updated ground truth value

* batch_processing: Fixed verbose bug

* spinalcordtoolbox/vertebrae/detect_c2c3: avg 7mm instead of 7slices

* scripts/sct_download_data: update download link for c2c3 models

* Output volume fraction on csv (#2122)

* aggregate_slicewise: Removed VertLevel in agg_metric if not exist

* aggregate_slicewise: Now display Label volume fraction

Fixes #2121

* aggregate_slicewise: Fixed regression on detection nan

* sct_extract_metric: Fixed bug with single mask as input

* sct_extract_metric: Now display file name in Label column

* test_aggregate_slicewise: Fixed unit test caused by recent changes

* sct_label_vertebrae: Removed support for initc2 (#2125)

User can do sct_label_utils()

* detect_c2c3: improvements -- postprocessing

* keep clusters with correct margin

* use normalised margin

* use top of the segmentation as anatomical prior

* dev/detect_c2c3/train: create qc, nb of sagittal slices avg

* spinalcordtoolbox/vertebrae/detect_c2c3: avg 7 sag slices, remove hard coded post processing

* spinalcordtoolbox/vertebrae/detect_c2c3: avg 7mm instead of 7slices

* scripts/sct_download_data: update download link for c2c3 models
jcohenadad added a commit that referenced this pull request Dec 18, 2019
User can do sct_label_utils()

Former-commit-id: fe30f1b
jcohenadad pushed a commit that referenced this pull request Dec 18, 2019
* detect_c2c3: improvements -- postprocessing

* keep clusters with correct margin

* use normalised margin

* use top of the segmentation as anatomical prior

* dev/detect_c2c3/train: create qc, nb of sagittal slices avg

* spinalcordtoolbox/vertebrae/detect_c2c3: avg 7 sag slices, remove hard coded post processing

* Update README.md (#2118)

* Expose aggregate_slicewise() API and various improvements (#2115)

* sct_extract_metric: Created API: extract_metric

* sct_extract_metric: Started refactoring to use aggregate_slicewise

* aggregate_slicewise: Started refactoring for accommodating extract_metric

- metrics is now ndarray (instead of list) to deal with >1 dim
- added mask for computing weighted average, ml, etc.

* sct_extract_metric,aggregate_slicewise: Main steps of working API

sct_extract_metric now working (in specific scenario) with new APIs.

* aggregate_slicewise,sct_extract_metric: Further improvements
- Moved Metric() class inside aggregate_slicewise
- Now display Mask in output csv
- Now display func with metric name (for compatibility with process_seg module)

* aggregate_slicewise: Changed variable name

* process_seg: Adapted code to fit recent changes in aggregate_slicewise

* msct_shape,process_seg: Adapted code to fit changes in aggregate_slicewise

Other modifications:
- drop features: incremental_length, distance_from_C1, vertebral_level

* test_process_seg: Fixed broken compatibility with recent changes

* sct_extract_metric,aggregate_slicewise: Refactored to generalize for ML and WA

Notably introduced label_struc Class inside sct_extract_metric for simplicity

* sct_extract_metric,aggregate_slicewise: Moved extract_metric inside aggregate_slicewise

Will enable unit testing

* aggregate_slicewise: Generalized to n-dim

was breaking compatibility with process_seg

* test_aggregate_slicewise: Started to update tests with recent changes

* aggregate_slicewise: Generalized to n-dim, added tests

* test_aggregate_slicewise: All tests pass

* test_aggregate_slicewise: Added test for csv

Testing output of extract_metric()
Also fixed few issues in aggregate_slicewise.py

* aggregate_slicewise: Fixed ordering of column in output csv

All tests pass

* aggregate_slicewise: Fixed issue with STD and ML method

* aggregate_slicewise: Changed the way errors are raised

* sct_extract_metric: Added field for appending to csv

* utils: Fixed bug in parse_num_list_inv()

Number of chars to adapt based on int

* aggregate_slicewise: Implemented method=bin and added test

* sct_extract_metric: Dropped support for method=wath

Not really used...

* aggregate_slicewise: Implemented method=max

And associated tests and wrapper

* sct_process_segmentation: Fixed broken compatibility

* msct_shape: Fixed bug when looping across slices

* sct_extract_metric: Fixed undeclared variable

* aggregate_slicewise: Removed weight in ML for faster estimate

Also started to implement MAP

* sct_extract_metric: Changed default value for perslice

* aggregate_slicewise: Implemented MAP (unfinished)

need to pass ml_clusters information to func_ml()

* aggregate_slicewise: Refactored for compatibility with MAP

* aggregate_slicewise: Fixed bug related to reshaping mask

Also added MAX in csv output

* aggregate_slicewise: Fixed wrong indentation for try/except

* aggregate_slicewise: Fixed duplicated dict key

* aggregate_slicewise: Added check for non-finite values

* test_sct_extract_metric: Updated test

* aggregate_slicewise: Fixed bug introduced with checking for nonfinite

* aggregate_slicewise: Fixed wrong reshape of array

* batch_processing: Update with recent modifs in API

* aggregate_slicewise,sct_process_segmentation: Added TODO

* sct_process_segmentation,aggregate_slicewise: Changed default

Regarding perslice and perlevel. To be closer to previous behaviour.

* template: Now checking for inf in get_slices_from_vertebral_levels

* sct_extract_metric: Few improvements

- Display output file
- Fixed default params

* aggregate_slicewise: Created merge_dict() to deal with dict of dict

Useful for sct_process_seg with several output metrics, to be able to concatenate them in a single csv

* sct_process_segmentation: Now output all metrics in the same csv

There's still a bug to solve in merge_dict()

* aggregate_slicewise: Fixed small bug in merge_dict

* aggregate_slicewise: Now ordering metrics in a friendly way

* test_aggregate_slicewise: Fixed bug caused by recent changes

* aggregate_slicewise: Forgot to add CSA and Angle

* batch_processing: Updated to match recent changes

* sct_extract_metric: Fixed deprecated default method wath

* test_sct_extract_metric: Updated ground truth value

* batch_processing: Fixed verbose bug

* spinalcordtoolbox/vertebrae/detect_c2c3: avg 7mm instead of 7slices

* scripts/sct_download_data: update download link for c2c3 models

* Output volume fraction on csv (#2122)

* aggregate_slicewise: Removed VertLevel in agg_metric if not exist

* aggregate_slicewise: Now display Label volume fraction

Fixes #2121

* aggregate_slicewise: Fixed regression on detection nan

* sct_extract_metric: Fixed bug with single mask as input

* sct_extract_metric: Now display file name in Label column

* test_aggregate_slicewise: Fixed unit test caused by recent changes

* sct_label_vertebrae: Removed support for initc2 (#2125)

User can do sct_label_utils()

* detect_c2c3: improvements -- postprocessing

* keep clusters with correct margin

* use normalised margin

* use top of the segmentation as anatomical prior

* dev/detect_c2c3/train: create qc, nb of sagittal slices avg

* spinalcordtoolbox/vertebrae/detect_c2c3: avg 7 sag slices, remove hard coded post processing

* spinalcordtoolbox/vertebrae/detect_c2c3: avg 7mm instead of 7slices

* scripts/sct_download_data: update download link for c2c3 models


Former-commit-id: 9217ece
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Incompatible API changes that necessitate a MAJOR version bump. Refer to https://semver.org/ enhancement category: improves performance/results of an existing feature sct_label_vertebrae context:
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants