fmriprep icon indicating copy to clipboard operation
fmriprep copied to clipboard

fmriprep trying to create folder that ends with a dot in its name in Windows?

Open sangillee opened this issue 5 years ago • 7 comments

Hi! I am running fmriPrep version 20.0.5 and I just began using it for a test run on a BIDS validated dataset. However, right after the automatically generated boilerplate message, I get several of the following errors (attached at the end). I checked my work directory and the folder is there, it just doesn't have the dot at the end of the name. i.e., there is a folder for /scratch/fmriprep_wf/single_subject_01_wf/func_preproc_task_faceplace_run_1_wf/bold_std_trans_wf/_std_target_MNI152NLin2009cAsym but fmriprep is trying to search for a one with a dot at the end, which cannot be created in windows. Any help please?

200321-03:36:03,119 nipype.workflow ERROR: Node select_tpl.a0 failed to run on host df005cc66f24. 200321-03:36:03,127 nipype.workflow ERROR: Saving crash info to /out/fmriprep/sub-01/log/20200321-033522_2ca6d4d0-5af9-41b4-ab04-daec6f3f9c76/crash-20200321-033603-root-select_tpl.a0-1735d110-e35e-4f4e-b31b-b2e4f8379f09.txt Traceback (most recent call last): File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 344, in _send_procs_to_workers self.procs[jobid].run(updatehash=updatehash) File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 507, in run os.makedirs(outdir, exist_ok=True) File "/usr/local/miniconda/lib/python3.7/os.py", line 211, in makedirs makedirs(head, exist_ok=exist_ok) File "/usr/local/miniconda/lib/python3.7/os.py", line 221, in makedirs mkdir(name, mode) FileNotFoundError: [Errno 2] No such file or directory: '/scratch/fmriprep_wf/single_subject_01_wf/func_preproc_task_faceplace_run_1_wf/bold_std_trans_wf/_std_target_MNI152NLin2009cAsym.'

When creating this crashfile, the results file corresponding to the node could not be found. 200321-03:36:03,252 nipype.workflow ERROR: Node split_target.a0 failed to run on host df005cc66f24. 200321-03:36:03,254 nipype.workflow ERROR: Saving crash info to /out/fmriprep/sub-01/log/20200321-033522_2ca6d4d0-5af9-41b4-ab04-daec6f3f9c76/crash-20200321-033603-root-split_target.a0-599129f2-8891-48ce-97c2-deb3a7001f48.txt Traceback (most recent call last): File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 344, in _send_procs_to_workers self.procs[jobid].run(updatehash=updatehash) File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 507, in run os.makedirs(outdir, exist_ok=True) File "/usr/local/miniconda/lib/python3.7/os.py", line 221, in makedirs mkdir(name, mode) FileNotFoundError: [Errno 2] No such file or directory: '/scratch/fmriprep_wf/single_subject_01_wf/func_preproc_task_faceplace_run_1_wf/bold_std_trans_wf/_std_target_MNI152NLin2009cAsym./split_target'

sangillee avatar Mar 21 '20 03:03 sangillee

This looks similar to https://github.com/poldracklab/fmriprep/issues/1944, what is the command you're using? Windows may require you to be more explicit with your output spaces.

mgxd avatar Mar 23 '20 20:03 mgxd

I see. Yes, indeed I was using the default output space. I'll try explicit specification and see if that resolves the issue.

sangillee avatar Mar 23 '20 20:03 sangillee

So, specifying the output space explicitly helped get over that particular error. This is the command I used: fmriprep-docker M:/FacePlace/BIDS M:/FacePlace/derivatives participant -w M:/ZZ_bench/workdir --fs-no-reconall --fs-license-file C:/FreeSurfer/license.txt --output-spaces MNI152NLin2009cAsym:res-2 --nthreads 16 --omp-nthreads 16 --skip_bids_validation --participant-label 02

But this time, I got a different error (maybe a related error) a bit farther down the road:

Node: fmriprep_wf.single_subject_02_wf.func_preproc_task_faceplace_run_1_wf.bold_reg_wf.fsl_bbr_wf.flt_bbr_init Working directory: /scratch/fmriprep_wf/single_subject_02_wf/func_preproc_task_faceplace_run_1_wf/bold_reg_wf/fsl_bbr_wf/flt_bbr_init

Node inputs:

angle_rep = apply_isoxfm = apply_xfm = args = bbrslope = bbrtype = bgvalue = bins = coarse_search = compress_report = auto cost = cost_func = datatype = display_init = dof = 6 echospacing = environ = {'FSLOUTPUTTYPE': 'NIFTI_GZ'} fieldmap = fieldmapmask = fine_search = force_scaling = in_file = in_matrix_file = in_weight = interp = min_sampling = no_clamp = no_resample = no_resample_blur = no_search = out_file = out_log = out_matrix_file = out_report = report.svg output_type = NIFTI_GZ padding_size = pedir = ref_weight = reference = rigid2D = save_log = schedule = searchr_x = searchr_y = searchr_z = sinc_width = sinc_window = uses_qform = True verbose = wm_seg = wmcoords = wmnorms =

Traceback (most recent call last): File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node result["result"] = node.run(updatehash=updatehash) File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 516, in run result = self._run_interface(execute=True) File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 635, in _run_interface return self._run_command(execute) File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 741, in _run_command result = self._interface.run(cwd=outdir) File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 398, in run runtime = self._post_run_hook(runtime) File "/usr/local/miniconda/lib/python3.7/site-packages/niworkflows/interfaces/registration.py", line 176, in _post_run_hook self._moving_image = self.aggregate_outputs(runtime=runtime).out_file File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/fsl/preprocess.py", line 731, in aggregate_outputs runtime=runtime, needed_outputs=needed_outputs File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 476, in aggregate_outputs predicted_outputs = self._list_outputs() # Predictions from _list_outputs File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/mixins/reporting.py", line 56, in _list_outputs outputs = super(ReportCapableInterface, self)._list_outputs() File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 927, in _list_outputs outputs[out_name] = os.path.abspath(fname) File "/usr/local/miniconda/lib/python3.7/posixpath.py", line 376, in abspath cwd = os.getcwd() FileNotFoundError: [Errno 2] No such file or directory

sangillee avatar Mar 24 '20 00:03 sangillee

Hi! I'm getting a similar error message using fmriprep via docker on win10 when explicitly specifying output spaces

I'm running the following command (fmriprep 21.0.2): docker run -ti --rm -v path/to/nifti:/data -v path/to/derivatives:/out -v path/to/workdir:/work -v path/to/fslicense:/licensePath nipreps/fmriprep:21.0.2 /data /out/fmriprep participant --participant-label 01 -w /work --output-space T1w --stop-on-first-crash --fs-license-file /licensePath/freesurfer.txt

Previously i successfully computed standard outputs (i.e. standard MNI152NLin2009cAsym) where i did not specify any output spaces. The same error persists when using the latest version of fmriprep. The dataset is bids compatible.

This is the error log: 230220-10:32:51,994 nipype.workflow ERROR: Saving crash info to /out/fmriprep/sub-01/log/20230220-102810_39d36581-9bc2-4a40-8b6f-9a1ca4ae6719/crash-20230220-103251-root-split_target.a0-f7845e58-629a-47eb-8c8a-ce0e7775b7c5.txt Traceback (most recent call last): File “/opt/conda/lib/python3.8/site-packages/nipype/pipeline/plugins/multiproc.py”, line 344, in _send_procs_to_workers self.procs[jobid].run(updatehash=updatehash) File “/opt/conda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py”, line 507, in run os.makedirs(outdir, exist_ok=True) File “/opt/conda/lib/python3.8/os.py”, line 223, in makedirs mkdir(name, mode) FileNotFoundError: [Errno 2] No such file or directory: ‘/work/fmriprep_wf/single_subject_01_wf/func_preproc_task_encoding_run_04_wf/bold_std_trans_wf/_std_target_MNI152NLin2009cAsym./split_target’

The folder being tried to access "_std_target_MNI152NLin2009cAsym." does not exist, only a version without the "." at the end. This directory in turn is empty so no files were stored here / can be accessed. Any tips or help would be much appreciated. Thx

hippocampeli avatar Feb 20 '23 11:02 hippocampeli

@hippocampeli What about using --output-spaces? I'm surprised --output-space doesn't produce an error...

effigies avatar Feb 22 '23 15:02 effigies

@hippocampeli What about using --output-spaces? I'm surprised --output-space doesn't produce an error...

hey, thanks for your reply. it didn't throw an error.. "fmriprep started successfully.. ". However, using --output-spaces doesn't change anything - same result.

hippocampeli avatar Feb 22 '23 16:02 hippocampeli

Okay. The easiest thing to do will just be to add --output-spaces MNI152NLin2009cAsym:res-2 (or res-native). I can't figure out at the moment where nipype is constructing these driectory names, so it's hard to tell how easy of a fix this will be. But it will almost certainly need to be in nipype, not fMRIPrep.

effigies avatar Feb 22 '23 16:02 effigies