#! /bin/bash


Folder_A="/home/sct/JZB/" #data_path
Folder_B="/home/sct/"  #code_path
#for folder_aa in ${Folder_A}/*
#do

for file_a in ${Folder_A}/*
do  
    path_=$file_a
    cd $path_
    #label_discs t22t2s
    
sct_deepseg_sc -i t2.nii.gz -c t2
sct_label_vertebrae -i t2.nii.gz -s t2_seg.nii.gz -c t2 

sct_deepseg_sc -i t2s.nii.gz -c t2s 
sct_deepseg_gm -i t2s.nii.gz 

sct_register_multimodal -i t2_seg_labeled.nii.gz -d t2s.nii.gz -identity 1 -x nn
sct_label_utils -i t2_seg_labeled_reg.nii.gz -vert-body 7 -o t2_labels_vert7.nii.gz
sct_label_utils -i t2_seg_labeled_reg.nii.gz -vert-body 3 -o t2_labels_vert3.nii.gz

sct_process_segmentation -i t2s_seg.nii.gz -vertfile t2_seg_labeled_reg.nii.gz -vert 1:9 -perlevel 1 -o csa_perlevel.csv


done
#done
