sct-pipeline / ukbiobank-spinalcord-csa

Measure of the averaged cross-sectional area (cord CSA) between C2 and C3 of the spinal cord with UK Biobank Brain MRI dataset.
MIT License
3 stars 0 forks source link

Suggestion to bypass registration to PAM50 template #44

Closed jcohenadad closed 3 years ago

jcohenadad commented 3 years ago

Context

The main goal of the project is to compute CSA at C2-C3. In order to do so, we need:

Currently, we idenfity C2-C3 and register to the PAM50, which seems to be an overkill (takes longer), and also is not precise if only based on the C2-C3 disc (eg: some people might have smaller/bigger vertebral bodies, which would not match that of the template).

Suggestion

To replace these lines: https://github.com/sct-pipeline/ukbiobank-spinalcord-csa/blob/8190a3fef268e452bcb15d3e6340135d4a965147/process_data.sh#L101-L117

by:

# Create disc labels at C1-C2, C2-C3 and C3-C4 (only if it does not exist) 
label_if_does_not_exist ${file_t1} ${file_t1_seg}
file_label=$FILELABEL
# Generate QC report to assess vertebral labeling
sct_qc -i ${file_t1}.nii.gz -s $FILELABEL -p sct_label_vertebrae -qc ${PATH_QC} -qc-subject ${SUBJECT}
# Flatten scan along R-L direction (to make nice figures)
sct_flatten_sagittal -i ${file_t1}.nii.gz -s ${file_t1_seg}.nii.gz
# Compute average cord CSA between C2 and C3
sct_process_segmentation -i ${file_t1_seg}.nii.gz -vert 2:3 -vertfile SEG_LABELED -o ${PATH_RESULTS}/csa-SC_T1w.csv -append 1

The shell function will also need to be updated: before: https://github.com/sct-pipeline/ukbiobank-spinalcord-csa/blob/8190a3fef268e452bcb15d3e6340135d4a965147/process_data.sh#L39-L47

after:

  if [[ -e $FILELABELMANUAL ]]; then
    echo "Found! Using manual labels."
    rsync -avzh $FILELABELMANUAL ${FILELABEL}.nii.gz
    sct_label_vertebrae -i ${file_t1}.nii.gz -s SEG -discfile LABELS-MANUALS
    # TODO: make sure output file name is same as the case below
  else
    echo "Not found. Proceeding with automatic labeling."
    # Generate labeled segmentation
    sct_label_vertebrae -i ${file}.nii.gz -s ${file_seg}.nii.gz -c t1

The documentation and code for the manual correction also needs to be updated.