neuropoly / data-management

Repo that deals with datalad aspects for internal use
4 stars 0 forks source link

Manual modification to GT lesions #209

Closed naga-karthik closed 1 year ago

naga-karthik commented 1 year ago

We (I and @kiristern) went over the entire dataset to check and correct existing GT lesions as it was found out during model training that the dataset was missing some lesions.

All the corrections are pushed to git annex and are available at this branch nk/fixed_lesions. @jcohenadad could you please take a look at them? Also, is there a way to send this modified dataset to the collaborators so that they can take a look (instead of using showing gifs)?

jcohenadad commented 1 year ago

@naga-karthik I'm happy to review them-- could you please propose a SHELL syntax that will get me loop across subjects, load image and your GT as overlay with another color-- that will save me 2min-- thx

naga-karthik commented 1 year ago

Sure! Once you're in the folder, here's the script to go over all the subjects and sessions


START=XX        # first subject to iterate over
END=XX         # last subject 

# iterate over the dataset
for i in $(seq -f "%02g" $START $END); do 

    # get the number of sessions for each subject
    num_sessions=$(ls sub-zh${i}/ | wc -l)

    # iterate over the sessions of each subject
    for j in $(seq -f "%02g" 1 $num_sessions); do

        fsleyes sub-zh${i}/ses-${j}/anat/sub-zh${i}_ses-${j}_acq-sag_T2w.nii.gz derivatives/labels/sub-zh${i}/ses-${j}/anat/sub-zh${i}_ses-${j}_acq-sag_T2w_lesion-manual.nii.gz -cm red-yellow

    done     

done
jcohenadad commented 1 year ago

as discussed in meeting i'll hold on and @naga-karthik will tag me whenever is a good time for review

valosekj commented 1 year ago

@naga-karthik, when switching to nk/fixed_lesions branch, I got the following error:

valosek@macbook-pro:~/data/data.neuro.polymtl.ca/sci-zurich$ git checkout nk/fixed_lesions                        
Switched to branch 'nk/fixed_lesions'
Your branch is up to date with 'origin/nk/fixed_lesions'.
  derivatives/labels/sub-zh12/ses-03/anat/sub-zh12_ses-03_acq-sag_T2w_lesion-manual.nii.gz is a git-annex pointer file. Its content is not available in this repository. (Maybe derivatives/labels/sub-zh12/ses-03/anat/sub-zh12_ses-03_acq-sag_T2w_lesion-manual.nii.gz was copied from another repository?)
  derivatives/labels/sub-zh31/ses-01/anat/sub-zh31_ses-01_acq-sag_T2w_lesion-manual.nii.gz is a git-annex pointer file. Its content is not available in this repository. (Maybe derivatives/labels/sub-zh31/ses-01/anat/sub-zh31_ses-01_acq-sag_T2w_lesion-manual.nii.gz was copied from another repository?)
  derivatives/labels/sub-zh34/ses-01/anat/sub-zh34_ses-01_acq-sag_T2w_lesion-manual.nii.gz is a git-annex pointer file. Its content is not available in this repository. (Maybe derivatives/labels/sub-zh34/ses-01/anat/sub-zh34_ses-01_acq-sag_T2w_lesion-manual.nii.gz was copied from another repository?)
  derivatives/labels/sub-zh35/ses-01/anat/sub-zh35_ses-01_acq-sag_T2w_lesion-manual.nii.gz is a git-annex pointer file. Its content is not available in this repository. (Maybe derivatives/labels/sub-zh35/ses-01/anat/sub-zh35_ses-01_acq-sag_T2w_lesion-manual.nii.gz was copied from another repository?)
  derivatives/labels/sub-zh40/ses-01/anat/sub-zh40_ses-01_acq-sag_T2w_lesion-manual.nii.gz is a git-annex pointer file. Its content is not available in this repository. (Maybe derivatives/labels/sub-zh40/ses-01/anat/sub-zh40_ses-01_acq-sag_T2w_lesion-manual.nii.gz was copied from another repository?)
  sub-zh12/ses-03/anat/sub-zh12_ses-03_acq-sag_T2w_lesion-manual.nii.gz is a git-annex pointer file. Its content is not available in this repository. (Maybe sub-zh12/ses-03/anat/sub-zh12_ses-03_acq-sag_T2w_lesion-manual.nii.gz was copied from another repository?)

After discussion with @mguaypaq, it seems that the branch has information that files exist, but the files have not been pushed. Could you please run the following commands (from intranet) on your computer:

git annex copy --to=origin
git annex sync --no-content --only-annex
naga-karthik commented 1 year ago

Thanks for pointing this out! I just ran those commands, can you please try switching to my branch again?

naga-karthik commented 1 year ago

@jcohenadad We (I and @valosekj) went over all the comments from Dario (see here for comments) and fixed the lesion annotations for the entire dataset. They are now ready to be merged to master. Could you please take a look and merge it? Thanks in advance!

The branch is jv/fixed_lesions.

jcohenadad commented 1 year ago

@jcohenadad We (I and @valosekj) went over all the comments from Dario (see here for comments) and fixed the lesion annotations for the entire dataset. They are now ready to be merged to master. Could you please take a look and merge it? Thanks in advance!

Would it be possible to send me the QC report of the ground truth lesion (using the new lesion QC once it works for sagittal scans)?

naga-karthik commented 1 year ago

Based on an internal discussion (Julien, Jan and I), we concluded that the new lesion QC for this sci-zurich is tricky because of sagittal images and lack of the SC segmentation. Hence, for the time being we merge the corrections on this dataset because it has been already verified by Dario (see here)

So, @mguaypaq could you please merge this branch jv/fixed_lesions to master? Thanks in advance!

mguaypaq commented 1 year ago

The git branching and merging structure was getting a bit complicated, so I rebased the branch onto master before merging. Also, I noticed (thanks to bids-validator) that there was a stray file in the wrong location:

sub-zh02/ses-01/anat/sub-zh02_ses-01_acq-sag_T2w_lesion-manual.nii.gz

After checking with @valosekj, I deleted the file.

For any further changes, I would suggest starting a fresh branch from the most recent master (instead of re-using jv/fixed_lesions or nk/fixed_lesions or ks/fix-GT), otherwise the git history could get messy.