Skip to content

Commit

Permalink
account for spaces in path when running tmi
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenny Chen committed Dec 10, 2024
1 parent 2b29f22 commit 76ff609
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
2 changes: 2 additions & 0 deletions designer2/tmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ def execute(): #pylint: disable=unused-variable
import pandas as pd

outdir = path.from_user(app.ARGS.output, True)
if outdir[0]=="'" and outdir[-1]=="'":
outdir= outdir.replace("'","")
if not os.path.exists(outdir):
os.makedirs(outdir)

Expand Down
2 changes: 1 addition & 1 deletion lib/designer_fit_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def save_params(paramDict, niiex, model, outdir):

params = paramDict.keys()
for key in params:
outpath = os.path.join(outdir, ('%s_%s.nii' % (key, model)))
outpath = os.path.join(r"{}".format(outdir), ("%s_%s.nii" % (key, model)))
vol = paramDict[key]
ndims = vol.ndim

Expand Down
41 changes: 23 additions & 18 deletions tests/input_test_jc_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,27 @@ r_json_wrong=/Users/jc8329/Desktop/test/M0033/M0033_043YF_DIFF_meso_research_.js
r_json=/Users/jc8329/Desktop/test/M0033/M0033_043YF_DIFF_meso_research.json

#test
root=/Users/jc8329/Desktop/test/M0033
meso=/data/M0033_043YF_DIFF_meso.nii
pa=/data/M0033_043YF_DIFF_meso_PA.nii
research=/data/M0033_043YF_DIFF_meso_research.nii
docker run --rm -it -v ${root}:/data test_petable/designer2:main designer \
-eddy -rpe_pair $pa \
-mask -nocleanup \
-scratch /data/processing_json \
$meso,$research /data/dwi_designer_json.nii
# root=/Users/jc8329/Desktop/test/M0033
# meso=/data/M0033_043YF_DIFF_meso.nii
# pa=/data/M0033_043YF_DIFF_meso_PA.nii
# research=/data/M0033_043YF_DIFF_meso_research.nii
# docker run --rm -it -v ${root}:/data test_petable/designer2:main designer \
# -eddy -rpe_pair $pa \
# -mask -nocleanup \
# -scratch /data/processing_json \
# $meso,$research /data/dwi_designer_json.nii

meso=/data/temp/M0033_043YF_DIFF_meso.nii
pa=/data/temp/M0033_043YF_DIFF_meso_PA.nii
research=/data/temp/M0033_043YF_DIFF_meso_research.nii
docker run --rm -it -v ${root}:/data test_petable/designer2:main designer \
-eddy -rpe_pair $pa_ \
-pf 6/8 -pe_dir j- \
-mask -nocleanup \
-scratch /data/temp/processing_nojson \
$meso_,$research_ /data/dwi_designer_nojson.nii
# meso=/data/temp/M0033_043YF_DIFF_meso.nii
# pa=/data/temp/M0033_043YF_DIFF_meso_PA.nii
# research=/data/temp/M0033_043YF_DIFF_meso_research.nii
# docker run --rm -it -v ${root}:/data test_petable/designer2:main designer \
# -eddy -rpe_pair $pa_ \
# -pf 6/8 -pe_dir j- \
# -mask -nocleanup \
# -scratch /data/temp/processing_nojson \
# $meso_,$research_ /data/dwi_designer_nojson.nii

folder=M0033
docker run --rm --platform linux/amd64 -it -v /Users/jc8329/Desktop/test/$folder:/data test_fit/designer2:main \
tmi -DKI -DTI -mask /data/brain_mask.nii \
/data/dwi_designer.mif /data/params_test

0 comments on commit 76ff609

Please sign in to comment.