neuropoly / template

A framework for creating unbiased MRI templates of the spinal cord
MIT License
5 stars 3 forks source link

Fixing issue #68 by generating a centerline NIFTI file for subjects who do not have a SC mask NIFTI file #69

Closed NadiaBlostein closed 11 months ago

NadiaBlostein commented 11 months ago

Fixing issue #68: In preprocess_normalize.py, the straighten_all_subjects() method requires for each subject to either have a SC mask NIFTI file (*_label-SC_mask.nii.gz) or a centerline NIFTI file (*_label-centerline.nii.gz). The current PR allows for preprocess_normalize.py to generate a centerline NIFTI file for each subject that has neither a SC mask NIFTI file nor a centerline NIFTI file.

Fixes #70

NadiaBlostein commented 11 months ago

title + body of the PR should be "human readable" as i said multiple times in the past-- @rohanbanerjee will review/modify first, then I review

Is this better?

NadiaBlostein commented 11 months ago

@jcohenadad will do tomorrow am

@rohanbanerjee If you read this part of the code, the straightening should not work if there is no SC mask NIFTI file or centerline NIFTI file to read in. Am I missing something?

Cheers

jcohenadad commented 11 months ago

@jcohenadad will do tomorrow am

in the interest of time, @rohanbanerjee can you please do it now so we can merge

rohanbanerjee commented 11 months ago

@NadiaBlostein Yes indeed, the straighten_all_subjects() method would not work if there is not SC mask or centerline file. But the point that I made was that no user should run the preprocess_normalize.py until they have confirmed that there is a SC/centerline present for each and every subject they have -- which is step 1.3. They should run step 1.6 which is running the preprocess_normalize.py after 1.3 and also possibly after qc (step 1.4)

jcohenadad commented 11 months ago

@rohanbanerjee as per https://github.com/neuropoly/template/pull/69/commits/16fa7569dd37a0fa54b4f3a35be3d7e7cc187205, make sure to ALWAYS update the PR body according to our conventions. I did it for you: Screen Shot 2023-08-09 at 10 21 05 AM

but please in the future follow our directives

jcohenadad commented 11 months ago

Testing this PR with the dog data. Data: duke/temp/rohan/bids_data Code: 16fa7569dd37a0fa54b4f3a35be3d7e7cc187205 config file:

{
    "path_data": "PATH_TO_BIDS_DATA",
    "include-list": "sub-HarshmanDobby",
    "data_type": "anat",
    "contrast": "t2",
    "suffix_image": "_T2",
    "first_disc": "1",
    "last_disc": "26"
}
rohanbanerjee commented 11 months ago

Hello @NadiaBlostein, did you decide about this PR? Could you please go ahead with either closing it or merging it. I am waiting on this PR for a few other PRs that I would like to open.

NadiaBlostein commented 11 months ago

Hey! I'm working on my other lab project this week and moving out of the country. Aren't other people now working on this?

NadiaBlostein commented 11 months ago

@rohanbanerjee I'll just merge this one because all the issues with it that were mentioned in the last meeting have been opened as separate issues