Skip to content

Commit

Permalink
Check if the centroid exist
Browse files Browse the repository at this point in the history
  • Loading branch information
frheault committed Dec 6, 2022
1 parent 36e43ee commit 1c9b736
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ process Resample_Centroid {
bname=\${bname/_centroid/}
bname=\${bname/_ic/}
scil_resample_streamlines.py \$bundle \
echo \$(scil_resample_streamlines.py \$bundle \
"${sid}__\${bname}_centroid_${params.nb_points}.trk" \
--nb_pts_per_streamline $params.nb_points -f
--nb_pts_per_streamline $params.nb_points -f)
done
"""
}
Expand Down Expand Up @@ -256,15 +256,17 @@ process Bundle_Label_And_Distance_Maps {
bname=\${bname/_ic/}
centroid=${sid}__\${bname}_centroid_${params.nb_points}.trk
scil_compute_bundle_voxel_label_map.py \$bundle \${centroid} tmp_out\
--min_streamline_count ${params.min_streamline_count} \
--min_voxel_count ${params.min_voxel_count} -f
mv tmp_out/labels_map.nii.gz ${sid}__\${bname}_labels.nii.gz
mv tmp_out/distance_map.nii.gz ${sid}__\${bname}_distances.nii.gz
mv tmp_out/labels.trk ${sid}__\${bname}_labels.trk
mv tmp_out/distance.trk ${sid}__\${bname}_distances.trk
if [[ -f \${centroid} ]]; then
scil_compute_bundle_voxel_label_map.py \$bundle \${centroid} tmp_out\
--min_streamline_count ${params.min_streamline_count} \
--min_voxel_count ${params.min_voxel_count} -f
mv tmp_out/labels_map.nii.gz ${sid}__\${bname}_labels.nii.gz
mv tmp_out/distance_map.nii.gz ${sid}__\${bname}_distances.nii.gz
mv tmp_out/labels.trk ${sid}__\${bname}_labels.trk
mv tmp_out/distance.trk ${sid}__\${bname}_distances.trk
fi
done
"""
Expand Down

0 comments on commit 1c9b736

Please sign in to comment.