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

Display vertebral level when using -perslice 1 option #3113

Closed
jcohenadad opened this issue Dec 20, 2020 · 1 comment · Fixed by #4004
Closed

Display vertebral level when using -perslice 1 option #3113

jcohenadad opened this issue Dec 20, 2020 · 1 comment · Fixed by #4004
Labels
feature category: new functionality good first issue Issues that new contributors can easily work on SCT API: aggregate_slicewise.py context:

Comments

@jcohenadad
Copy link
Member

When running sct_process_segmentation (or sct_extract_metric) with option perslice 1, each row corresponds to a slice. However, when doing so, the column "VertLevel" is empty:

Filename Slice (I->S) VertLevel MEAN(area)
/Users/julien/temp/20201217_inspired/results6/data_processed/HC02/bl/cord/processing_sct/t2_tra_seg.nii.gz 0   70.41316501066880
/Users/julien/temp/20201217_inspired/results6/data_processed/HC02/bl/cord/processing_sct/t2_tra_seg.nii.gz 1   76.68867922117070
/Users/julien/temp/20201217_inspired/results6/data_processed/HC02/bl/cord/processing_sct/t2_tra_seg.nii.gz 2   76.84621033344560
/Users/julien/temp/20201217_inspired/results6/data_processed/HC02/bl/cord/processing_sct/t2_tra_seg.nii.gz 3   81.27146085321930
/Users/julien/temp/20201217_inspired/results6/data_processed/HC02/bl/cord/processing_sct/t2_tra_seg.nii.gz 4   82.83952355053640

It shouldn't be empty, because we know the information about vertebral level, if user input vertebral labeling file, as was done here, with the flag -vertfile.

So as a feature, we should fill this column "VertLevel" when the vertebral level for each slice is known.

@jcohenadad jcohenadad added SCT API: aggregate_slicewise.py context: feature category: new functionality labels Dec 20, 2020
@joshuacwnewton
Copy link
Member

joshuacwnewton commented Dec 20, 2020

I very much agree with this suggestion. The blank space stood out to me too while writing #3094.

We already have the capability to get the level values, e.g. when we do -perslice 1 -vert:

vertgroups = [tuple([get_vertebral_level_from_slice(im_vert_level, i[0])]) for i in slicegroups]

But, for -perslice 1 -z we don't bother getting the level values for some reason.

So, I think a small tweak to this line in aggregate_per_slice_or_level() is all we need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature category: new functionality good first issue Issues that new contributors can easily work on SCT API: aggregate_slicewise.py context:
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants