From c3e04ce9e690c33a294fb0125889ff32f2e3eb2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Tue, 19 Sep 2023 17:58:04 -0400 Subject: [PATCH 1/2] ENH: Add executable flag to ORG atlas application script Add executable flag to ORG atlas application script: change permissions from `100644` to `100755`. --- bin/wm_apply_ORG_atlas_to_subject.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 bin/wm_apply_ORG_atlas_to_subject.sh diff --git a/bin/wm_apply_ORG_atlas_to_subject.sh b/bin/wm_apply_ORG_atlas_to_subject.sh old mode 100644 new mode 100755 From 3c89a1b9b66a9e8899bd32be4745ae933c1ff9d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Tue, 19 Sep 2023 18:00:12 -0400 Subject: [PATCH 2/2] BUG: Fix WM diffusion measurement Python script call for Linux Fix the WM diffusion measurement Python script call in the ORG atlas application shell script for Linux. As described in https://discourse.slicer.org/t/no-csv-file-in-diffusionmessurements-folder-in-wma/28439 the solution for Linux requires providing the Python script with the path to the 3D Slicer executable together with the `--launch` option and the path to the tract measurement 3D Slicer CLI executable as the last positional argument. --- bin/wm_apply_ORG_atlas_to_subject.sh | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/bin/wm_apply_ORG_atlas_to_subject.sh b/bin/wm_apply_ORG_atlas_to_subject.sh index 0cafe0d5..d338423c 100755 --- a/bin/wm_apply_ORG_atlas_to_subject.sh +++ b/bin/wm_apply_ORG_atlas_to_subject.sh @@ -389,22 +389,30 @@ fi if [ $DiffMeasure == 1 ]; then + os=$(uname) + + if [[ "$os" == 'Linux' ]]; then + measurement_cli_cmd=$SlicerPath" --launch "$FiberTractMeasurementsCLI + else + measurement_cli_cmd=$FiberTractMeasurementsCLI + fi + echo " Report diffusion measurements of fiber clusters." if [ ! -f $SeparatedClustersFolder/diffusion_measurements_commissural.csv ]; then wm_diffusion_measurements.py \ - $SeparatedClustersFolder/tracts_commissural $SeparatedClustersFolder/diffusion_measurements_commissural.csv "$FiberTractMeasurementsCLI" + $SeparatedClustersFolder/tracts_commissural $SeparatedClustersFolder/diffusion_measurements_commissural.csv "$measurement_cli_cmd" else echo " - diffusion measurements of commissural clusters has been done." fi if [ ! -f $SeparatedClustersFolder/diffusion_measurements_left_hemisphere.csv ]; then wm_diffusion_measurements.py \ - $SeparatedClustersFolder/tracts_left_hemisphere $SeparatedClustersFolder/diffusion_measurements_left_hemisphere.csv "$FiberTractMeasurementsCLI" + $SeparatedClustersFolder/tracts_left_hemisphere $SeparatedClustersFolder/diffusion_measurements_left_hemisphere.csv "$measurement_cli_cmd" else echo " - diffusion measurements of left hemisphere clusters has been done." fi if [ ! -f $SeparatedClustersFolder/diffusion_measurements_right_hemisphere.csv ]; then wm_diffusion_measurements.py \ - $SeparatedClustersFolder/tracts_right_hemisphere $SeparatedClustersFolder/diffusion_measurements_right_hemisphere.csv "$FiberTractMeasurementsCLI" + $SeparatedClustersFolder/tracts_right_hemisphere $SeparatedClustersFolder/diffusion_measurements_right_hemisphere.csv "$measurement_cli_cmd" else echo " - diffusion measurements of right hemisphere clusters has been done." fi @@ -422,10 +430,18 @@ echo "" if [ $DiffMeasure == 1 ]; then + os=$(uname) + + if [[ "$os" == 'Linux' ]]; then + measurement_cli_cmd=$SlicerPath" --launch "$FiberTractMeasurementsCLI + else + measurement_cli_cmd=$FiberTractMeasurementsCLI + fi + echo " Report diffusion measurements of the anatomical tracts." if [ ! -f $AnatomicalTractsFolder/diffusion_measurements_anatomical_tracts.csv ]; then wm_diffusion_measurements.py \ - $AnatomicalTractsFolder $AnatomicalTractsFolder/diffusion_measurements_anatomical_tracts.csv "$FiberTractMeasurementsCLI" + $AnatomicalTractsFolder $AnatomicalTractsFolder/diffusion_measurements_anatomical_tracts.csv "$measurement_cli_cmd" else echo " - diffusion measurements of anatomical tracts has been done." fi