diff --git a/designer2/tmi.py b/designer2/tmi.py index 62c5092..61c0bbb 100644 --- a/designer2/tmi.py +++ b/designer2/tmi.py @@ -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) diff --git a/lib/designer_fit_wrappers.py b/lib/designer_fit_wrappers.py index e069f72..dc9ae14 100644 --- a/lib/designer_fit_wrappers.py +++ b/lib/designer_fit_wrappers.py @@ -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 diff --git a/tests/input_test_jc_docker.sh b/tests/input_test_jc_docker.sh index 8cb534e..55669ce 100644 --- a/tests/input_test_jc_docker.sh +++ b/tests/input_test_jc_docker.sh @@ -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