Skip to content

Commit

Permalink
updated batch_processing and CHANGES
Browse files Browse the repository at this point in the history
  • Loading branch information
jcohenadad committed Jul 16, 2016
1 parent 0a8be8e commit 8185537
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 78 deletions.
6 changes: 5 additions & 1 deletion CHANGES.md
@@ -1,6 +1,7 @@
# CHANGES TO RELEASE

##3.0 (TBD)
- NEW: PAM50 template now used as the default template
- NEW: **sct_compute_snr**: compute SNR using several methods (Dietrich et al. 2007)
- NEW: **sct_propseg**: now accepts a correction solution for sct_propseg in case of missing CSF/SC contrast and/or artefacts (see issue #664 for details)
- NEW: **sct_propseg**: added flag to open a viewer for initializing spinal cord segmentation by manually providing a few points (issue #741)
Expand All @@ -9,13 +10,16 @@
- NEW: **sct_dmri_create_noisemask**: Identification and estimation of noise in the diffusion signal, implemented by the Dipy software project (http://nipy.org/dipy/), based on the PIESNO method
- NEW: **sct_register_graymatter**: Multi-label registration that accounts for gray matter shape.
- NEW: **sct_register_multimodal**: features two new transformations: centermassrot and columnwise.
- BUG: **sct_straighten_spinalcord**: Fixed #917, #924
- BUG: Fixed issues #715, #719
- BUG: **sct_propseg**: fixed issues #147, #242, #309, #376, #501, #544, #674, #680
- BUG: **sct_segment_graymatter**: fixed issues #782, #813, #815
- BUG: fixed incompatibility with CENTOS 6.X (issue #776)
- BUG: Fixed incompatibility with CENTOS 6.X (issue #776)
- BUG: Binaries now hosted on Gihub for accessibility from China (#927)
- OPT: **sct_check_dependencies**: Made test more sentitive to OS incompatibilities (issue #771)
- OPT: **sct_register_multimodal**: major changes. Simplified flags. Fixed issues #350, #404, #414, #499, #650, #735, #737, #749, #807, #818
- OPT: **sct_register_to_template**: now uses slicewise rigid transfo at first step (instead of slicereg), which improves accuracy (issue #666)
- OPT: **sct_label_vertebrae**: now fully automatic (although unstable-- work in progress).

##2.2.3 (2016-02-04)
- BUG: **sct_straighten_spinalcord**: fixed instabilities related to generation of labels (issue #722)
Expand Down
50 changes: 21 additions & 29 deletions batch_processing.sh
Expand Up @@ -39,54 +39,46 @@ if [ $DISPLAY = true ]; then
fslview t2 -b 0,800 t2_seg -l Red -t 0.5 &
fi
# Vertebral labeling. Here we use the fact that the FOV is centered at C7.
sct_label_vertebrae -i t2.nii.gz -s t2_seg.nii.gz -initcenter 7
sct_label_vertebrae -i t2.nii.gz -s t2_seg.nii.gz -c t2 -initcenter 7
# Create labels at C3 and T2 vertebral levels
sct_label_utils -i t2_seg_labeled.nii.gz -label-vert 3,9
sct_label_utils -i t2_seg_labeled.nii.gz -vert-body 3,9
# Register to template
sct_register_to_template -i t2.nii.gz -s t2_seg.nii.gz -l labels.nii.gz
sct_register_to_template -i t2.nii.gz -s t2_seg.nii.gz -l labels.nii.gz -c t2
# Warp template without the white matter atlas (we don't need it at this point)
sct_warp_template -d t2.nii.gz -w warp_template2anat.nii.gz -a 0
# check results
if [ $DISPLAY = true ]; then
fslview t2.nii.gz -b 0,800 label/template/MNI-Poly-AMU_T2.nii.gz -b 0,4000 label/template/MNI-Poly-AMU_level.nii.gz -l MGH-Cortical -t 0.5 label/template/MNI-Poly-AMU_GM.nii.gz -l Red-Yellow -b 0.5,1 label/template/MNI-Poly-AMU_WM.nii.gz -l Blue-Lightblue -b 0.5,1 &
fslview t2.nii.gz -b 0,800 label/template/PAM50_t2.nii.gz -b 0,4000 label/template/PAM50_levels.nii.gz -l MGH-Cortical -t 0.5 label/template/PAM50_gm.nii.gz -l Red-Yellow -b 0.5,1 label/template/PAM50_wm.nii.gz -l Blue-Lightblue -b 0.5,1 &
fi
# compute average cross-sectional area and volume between C3 and C4 levels
sct_process_segmentation -i t2_seg.nii.gz -p csa -vert 3:4
# go back to root folder
cd ..


# t1
# ----------
# t1
# ===========================================================================================
cd t1
# spinal cord segmentation
# Spinal cord segmentation
sct_propseg -i t1.nii.gz -c t1
# check results
# Check results:
if [ $DISPLAY = true ]; then
fslview t1 -b 0,800 t1_seg -l Red -t 0.5 &
fslview t1 -b 0,800 t2_seg -l Red -t 0.5 &
fi
# create mask around spinal cord (for cropping)
sct_create_mask -i t1.nii.gz -p centerline,t1_seg.nii.gz -size 61 -f box -o mask_t1.nii.gz
# crop t1 and t1_seg (for faster registration)
sct_crop_image -i t1.nii.gz -m mask_t1.nii.gz -o t1_crop.nii.gz
sct_crop_image -i t1_seg.nii.gz -m mask_t1.nii.gz -o t1_seg_crop.nii.gz
# register to template (which was previously registered to the t2).
sct_register_multimodal -i ../t2/label/template/MNI-Poly-AMU_T2.nii.gz -iseg ../t2/label/template/MNI-Poly-AMU_cord.nii.gz -d t1_crop.nii.gz -dseg t1_seg_crop.nii.gz -param step=1,type=seg,algo=slicereg,metric=MeanSquares:step=2,type=im,algo=syn,iter=3,gradStep=0.2,metric=CC
# concatenate transformations
sct_concat_transfo -w ../t2/warp_template2anat.nii.gz,warp_MNI-Poly-AMU_T22t1_crop.nii.gz -d t1.nii.gz -o warp_template2t1.nii.gz
sct_concat_transfo -w warp_t1_crop2MNI-Poly-AMU_T2.nii.gz,../t2/warp_anat2template.nii.gz -d $SCT_DIR/data/template/MNI-Poly-AMU_T2.nii.gz -o warp_t12template.nii.gz
# Vertebral labeling. Here we use the fact that the FOV is centered at C7.
sct_label_vertebrae -i t2.nii.gz -s t2_seg.nii.gz -initcenter 7
# Create labels at C3 and T2 vertebral levels
sct_label_utils -i t2_seg_labeled.nii.gz -label-vert 3,9
# Register to template
sct_register_to_template -i t2.nii.gz -s t2_seg.nii.gz -l labels.nii.gz
# Warp template without the white matter atlas (we don't need it at this point)
sct_warp_template -d t1.nii.gz -w warp_template2t1.nii.gz -a 0
# Check results
if [ $DISPLAY = true ]; then
fslview t1.nii.gz label/template/MNI-Poly-AMU_T2.nii.gz -b 0,4000 label/template/MNI-Poly-AMU_level.nii.gz -l MGH-Cortical -t 0.5 label/template/MNI-Poly-AMU_GM.nii.gz -l Red-Yellow -b 0.5,1 label/template/MNI-Poly-AMU_WM.nii.gz -l Blue-Lightblue -b 0.5,1 &
fi
# warp T1 to template space
sct_apply_transfo -i t1.nii.gz -d $SCT_DIR/data/template/MNI-Poly-AMU_T2.nii.gz -w warp_t12template.nii.gz
# check registration of T1 to template
sct_warp_template -d t2.nii.gz -w warp_template2anat.nii.gz -a 0
# check results
if [ $DISPLAY = true ]; then
fslview $SCT_DIR/data/template/MNI-Poly-AMU_T2.nii.gz -b 0,4000 t1_reg.nii.gz -b 0,800 &
fslview t2.nii.gz -b 0,800 label/template/PAM50_t2.nii.gz -b 0,4000 label/template/PAM50_levels.nii.gz -l MGH-Cortical -t 0.5 label/template/PAM50_gm.nii.gz -l Red-Yellow -b 0.5,1 label/template/PAM50_wm.nii.gz -l Blue-Lightblue -b 0.5,1 &
fi
# compute average cross-sectional area and volume between C3 and C4 levels
sct_process_segmentation -i t2_seg.nii.gz -p csa -vert 3:4
# go back to root folder
cd ..


Expand Down
47 changes: 0 additions & 47 deletions batch_processing_PAM50.sh

This file was deleted.

2 changes: 1 addition & 1 deletion commit.txt
@@ -1 +1 @@
2e97bf0ee479c726bc3acca2d79b187c3cece9c4
0a8be8eab4c8a29fda28a65c2f80910f0e7612ce

0 comments on commit 8185537

Please sign in to comment.