Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on "gen_eddy_files" #172

Open
h-w-k opened this issue May 28, 2021 · 1 comment
Open

Error on "gen_eddy_files" #172

h-w-k opened this issue May 28, 2021 · 1 comment

Comments

@h-w-k
Copy link

h-w-k commented May 28, 2021

  • dmriprep version: 0.5.0rc0
  • Operating System: Linux

Description

I ran dmriprep on Phillips data using the following dMRIPREP command,

dmriprep /work /output participant --participant_label sub-002 --fs-license-file /main/licens.txt --output-spaces T1w --use-syn-sdc --skip-bids-validation -w /main/WORK

Errors occured in "gen_eddy_files" shown in html report
"Node Name: dmriprep_wf.single_subkect_002_wf.dwi_preproc_ses_01_run001_wf.eddy.wf.gen_eddy_files
Node Name: dmriprep_wf.single_subkect_002_wf.dwi_preproc_ses_01_run001_dti_wf.eddy_wf.gen_eddy_files"

Please kindly advise how to fix it.

I think it is about PhaseEncodingDirection and Total Readout Time, which are required in the node. If it is the case, how could I input the required data in dMRIPREP command line?

Thank you very much.

@margokersey
Copy link

Hi, I believe I am also having the same issue as you. In the output file on my HPC I am getting the error:
nipype.workflow ERROR: Node gen_eddy_files failed to run on host (hostname here)

I tried adding more memory to the job file (20G) but it did not change the result. I believe I have the B0FieldIdentifier and B0FieldSource fields filled out correctly in the JSON files. I also have the IntendedFor field filled out just in case.

in AP phase encoding JSON:
"TotalReadoutTime": 0.0305196,
"PhaseEncodingDirection": "j-",
"IntendedFor": ["ses-20220822/dwi/sub-34115_ses-20220822_acq-b500_dir-30_dwi.nii.gz",
"ses-20220822/dwi/sub-34115_ses-20220822_acq-b1000_dir-64_dwi.nii.gz",
"ses-20220822/dwi/sub-34115_ses-20220822_acq-b2500_dir-96_dwi.nii.gz"],
"B0FieldIdentifier": "pepolar"

in PA phase encoding JSON:
"TotalReadoutTime": 0.0305196,
"PhaseEncodingDirection": "j",
"IntendedFor": ["ses-20220822/dwi/sub-34115_ses-20220822_acq-b500_dir-30_dwi.nii.gz",
"ses-20220822/dwi/sub-34115_ses-20220822_acq-b1000_dir-64_dwi.nii.gz",
"ses-20220822/dwi/sub-34115_ses-20220822_acq-b2500_dir-96_dwi.nii.gz"],
"B0FieldIdentifier": "pepolar"

in b500/b1000/b2500 JSON:
"TotalReadoutTime": 0.0305196,
"PhaseEncodingDirection": "j-",
"B0FieldSource": "pepolar"

In the subject's html file, the errors are the following:

(Removed in_meta field for privacy)

Errors

Node Name: dmriprep_wf.single_subject_01_wf.dwi_preproc_ses_20220822_acq_b2500_dir_96_wf.eddy_wf.gen_eddy_files

File: /out/dmriprep/sub-01/log/20230306-131934_90711f6c-910e-4008-a322-2bdfba99d6a5/crash-20230306-132033-mkersey-gen_eddy_files-e43cd7c6-3ff5-4576-bd0f-913add0d63e7.txt
Working Directory: /out/workdir/dmriprep_wf/single_subject_01_wf/dwi_preproc_ses_20220822_acq_b2500_dir_96_wf/eddy_wf/gen_eddy_files
Inputs:

  • function_str: def gen_eddy_textfiles(in_file, in_meta): """ Generate the acquisition-parameters and index files for FSL eddy_openmp. Examples -------- >>> out_acqparams, out_index = gen_eddy_textfiles( ... "dwi.nii.gz", ... {"PhaseEncodingDirection": "j-", "TotalReadoutTime": 0.005}, ... ) >>> Path(out_acqparams).read_text() '0 -1 0 0.0050000' >>> Path(out_index).read_text() '1 1 1 1 1 1' """ from pathlib import Path import nibabel as nb from sdcflows.utils.epimanip import get_trt from nipype.utils.filemanip import fname_presuffix # Generate output file name out_acqparams = fname_presuffix( in_file, suffix="_acqparams.txt", use_ext=False, ) pe_dir = in_meta["PhaseEncodingDirection"] fsl_pe = ["0"] * 3 fsl_pe["ijk".index(pe_dir[0])] = "-1" if pe_dir.endswith("-") else "1" # Write to the acqp file try: Path(out_acqparams).write_text( f"{' '.join(fsl_pe)} {get_trt(in_meta, in_file=in_file):0.7f}" ) except ValueError: Path(out_acqparams).write_text(f"{' '.join(fsl_pe)} {0.05}") out_index = fname_presuffix( in_file, suffix="_index.txt", use_ext=False, ) Path(out_index).write_text(f"{' '.join(['1'] * nb.load(in_file).shape[3])}") return out_acqparams, out_index

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 434, in run
runtime = self._run_interface(runtime)
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/utility/wrappers.py", line 142, in _run_interface
out = function_handle(**args)
File "", line 37, in gen_eddy_textfiles
File "/usr/local/miniconda/lib/python3.7/pathlib.py", line 1208, in write_text
with self.open(mode='w', encoding=encoding, errors=errors) as f:
File "/usr/local/miniconda/lib/python3.7/pathlib.py", line 1176, in open
opener=self._opener)
File "/usr/local/miniconda/lib/python3.7/pathlib.py", line 1030, in _opener
return self._accessor.open(self, flags, mode)
OSError: [Errno 30] Read-only file system: '/data/sub-01/ses-20220822/dwi/sub-01_ses-20220822_acq-b2500_dir-96_dwi_acqparams.txt'

Node Name: dmriprep_wf.single_subject_01_wf.dwi_preproc_ses_20220822_acq_b1000_dir_64_wf.eddy_wf.gen_eddy_files

File: /out/dmriprep/sub-01/log/20230306-131934_90711f6c-910e-4008-a322-2bdfba99d6a5/crash-20230306-132033-mkersey-gen_eddy_files-f50f3e90-2439-4367-9e40-d609448c1ea0.txt
Working Directory: /out/workdir/dmriprep_wf/single_subject_01_wf/dwi_preproc_ses_20220822_acq_b1000_dir_64_wf/eddy_wf/gen_eddy_files
Inputs:

  • function_str: def gen_eddy_textfiles(in_file, in_meta): """ Generate the acquisition-parameters and index files for FSL eddy_openmp. Examples -------- >>> out_acqparams, out_index = gen_eddy_textfiles( ... "dwi.nii.gz", ... {"PhaseEncodingDirection": "j-", "TotalReadoutTime": 0.005}, ... ) >>> Path(out_acqparams).read_text() '0 -1 0 0.0050000' >>> Path(out_index).read_text() '1 1 1 1 1 1' """ from pathlib import Path import nibabel as nb from sdcflows.utils.epimanip import get_trt from nipype.utils.filemanip import fname_presuffix # Generate output file name out_acqparams = fname_presuffix( in_file, suffix="_acqparams.txt", use_ext=False, ) pe_dir = in_meta["PhaseEncodingDirection"] fsl_pe = ["0"] * 3 fsl_pe["ijk".index(pe_dir[0])] = "-1" if pe_dir.endswith("-") else "1" # Write to the acqp file try: Path(out_acqparams).write_text( f"{' '.join(fsl_pe)} {get_trt(in_meta, in_file=in_file):0.7f}" ) except ValueError: Path(out_acqparams).write_text(f"{' '.join(fsl_pe)} {0.05}") out_index = fname_presuffix( in_file, suffix="_index.txt", use_ext=False, ) Path(out_index).write_text(f"{' '.join(['1'] * nb.load(in_file).shape[3])}") return out_acqparams, out_index

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 434, in run
runtime = self._run_interface(runtime)
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/utility/wrappers.py", line 142, in _run_interface
out = function_handle(**args)
File "", line 37, in gen_eddy_textfiles
File "/usr/local/miniconda/lib/python3.7/pathlib.py", line 1208, in write_text
with self.open(mode='w', encoding=encoding, errors=errors) as f:
File "/usr/local/miniconda/lib/python3.7/pathlib.py", line 1176, in open
opener=self._opener)
File "/usr/local/miniconda/lib/python3.7/pathlib.py", line 1030, in _opener
return self._accessor.open(self, flags, mode)
OSError: [Errno 30] Read-only file system: '/data/sub-01/ses-20220822/dwi/sub-01_ses-20220822_acq-b1000_dir-64_dwi_acqparams.txt'

Node Name: dmriprep_wf.single_subject_01_wf.fmap_preproc_wf.wf_pepolar_fmap0.concat_blips

File: /out/dmriprep/sub-01/log/20230306-131934_90711f6c-910e-4008-a322-2bdfba99d6a5/crash-20230306-132035-mkersey-concat_blips-90c5cd72-c066-4afe-95f1-3446cca0a283.txt
Working Directory: /out/workdir/dmriprep_wf/single_subject_01_wf/fmap_preproc_wf/wf_pepolar_fmap0/concat_blips
Inputs:

  • allow_4D: True
  • in_files:
    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 434, in run
    runtime = self._run_interface(runtime)
    File "/usr/local/miniconda/lib/python3.7/site-packages/niworkflows/interfaces/nibabel.py", line 171, in _run_interface
    img_4d = nb.concat_images(nii_list)
    File "/usr/local/miniconda/lib/python3.7/site-packages/nibabel/funcs.py", line 141, in concat_images
    raise ValueError(f'Affine for image {i} does not match affine for first image')
    ValueError: Affine for image 1 does not match affine for first image

Node Name: dmriprep_wf.single_subject_01_wf.dwi_preproc_ses_20220822_acq_b500_dir_30_wf.eddy_wf.gen_eddy_files

File: /out/dmriprep/sub-01/log/20230306-131934_90711f6c-910e-4008-a322-2bdfba99d6a5/crash-20230306-132035-mkersey-gen_eddy_files-82dfde7a-9c8a-4a6c-ab0b-d1ffd0a3c6d6.txt
Working Directory: /out/workdir/dmriprep_wf/single_subject_01_wf/dwi_preproc_ses_20220822_acq_b500_dir_30_wf/eddy_wf/gen_eddy_files
Inputs:

  • function_str: def gen_eddy_textfiles(in_file, in_meta): """ Generate the acquisition-parameters and index files for FSL eddy_openmp. Examples -------- >>> out_acqparams, out_index = gen_eddy_textfiles( ... "dwi.nii.gz", ... {"PhaseEncodingDirection": "j-", "TotalReadoutTime": 0.005}, ... ) >>> Path(out_acqparams).read_text() '0 -1 0 0.0050000' >>> Path(out_index).read_text() '1 1 1 1 1 1' """ from pathlib import Path import nibabel as nb from sdcflows.utils.epimanip import get_trt from nipype.utils.filemanip import fname_presuffix # Generate output file name out_acqparams = fname_presuffix( in_file, suffix="_acqparams.txt", use_ext=False, ) pe_dir = in_meta["PhaseEncodingDirection"] fsl_pe = ["0"] * 3 fsl_pe["ijk".index(pe_dir[0])] = "-1" if pe_dir.endswith("-") else "1" # Write to the acqp file try: Path(out_acqparams).write_text( f"{' '.join(fsl_pe)} {get_trt(in_meta, in_file=in_file):0.7f}" ) except ValueError: Path(out_acqparams).write_text(f"{' '.join(fsl_pe)} {0.05}") out_index = fname_presuffix( in_file, suffix="_index.txt", use_ext=False, ) Path(out_index).write_text(f"{' '.join(['1'] * nb.load(in_file).shape[3])}") return out_acqparams, out_index

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 434, in run
runtime = self._run_interface(runtime)
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/utility/wrappers.py", line 142, in _run_interface
out = function_handle(**args)
File "", line 37, in gen_eddy_textfiles
File "/usr/local/miniconda/lib/python3.7/pathlib.py", line 1208, in write_text
with self.open(mode='w', encoding=encoding, errors=errors) as f:
File "/usr/local/miniconda/lib/python3.7/pathlib.py", line 1176, in open
opener=self._opener)
File "/usr/local/miniconda/lib/python3.7/pathlib.py", line 1030, in _opener
return self._accessor.open(self, flags, mode)
OSError: [Errno 30] Read-only file system: '/data/sub-01/ses-20220822/dwi/sub-01_ses-20220822_acq-b500_dir-30_dwi_acqparams.txt'

Thank you so much in advance for any insight on how to fix this problem!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants