Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions sdcflows/fieldmaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,8 @@ class FieldmapFile:
@path.validator
def check_path(self, attribute, value):
"""Validate a fieldmap path."""
if not value.is_file():
raise FileNotFoundError(
f'File path <{value}> does not exist, is a broken link, or it is not a file'
)
if not value.is_file() and not value.is_symlink():
raise FileNotFoundError(f'File path <{value}> does not exist, or it is not a file')

if not value.name.endswith(('.nii', '.nii.gz')):
raise ValueError(f'File path <{value}> does not look like a NIfTI file.')
Expand Down Expand Up @@ -472,6 +470,13 @@ def get_workflow(self, set_inputs=True, **kwargs):
if self.method in (EstimatorType.MAPPED, EstimatorType.PHASEDIFF):
from .workflows.fit.fieldmap import init_fmap_wf

for f in self.sources:
if not f.path.is_file():
raise FileNotFoundError(
f'File path <{f.path}> does not exist, '
'is a broken link, or it is not a file'
)

kwargs['mode'] = str(self.method).rpartition('.')[-1].lower()
self._wf = init_fmap_wf(**kwargs)
if set_inputs:
Expand Down
Loading