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

FSL FAST output PATH problems #3593

Open
Ede1994 opened this issue Jul 25, 2023 · 0 comments
Open

FSL FAST output PATH problems #3593

Ede1994 opened this issue Jul 25, 2023 · 0 comments

Comments

@Ede1994
Copy link

Ede1994 commented Jul 25, 2023

Summary

When using fsl.FAST() the outout files are written to a completely different output dir than specified. For other FSL tools like BET or FLIRT everything works without problems, with the same paths.

Actual behavior

The output of FAST is currently not generated because an unspecified path is used for the output. Reason unknown.

Expected behavior

All outputs should be stored in dstFilePath as specified.

Script/Workflow details

from nipype.interfaces import fsl

def fast(src_path, dst_path, img_type=1):
    fast = fsl.FAST()
    fast.inputs.in_files = src_path
    fast.inputs.img_type = img_type # (1 or 2 or 3)
    fast.inputs.hyper = 0.3
    fast.inputs.bias_iters = 1
    fast.inputs.number_classes = 3
    fast.inputs.out_basename = dst_path
    logging.info('FSL FAST cmd line: {}'.format(fast.cmdline))
    res = fast.run()
    return

for niiGzFile, stripFile in zip(niiGzPaths, stripFiles):
        path, file = os.path.split(stripFile)
        print('strip file: ', stripFile)

        ### Run FAST segmentation ###
        dstFile = file.split('.')[0]
        dstFilePath = path + '/' + dstFile
        print(dstFile)
        print(dstFilePath)
        segFiles.append(dstFilePath)
        logging.info('FAST Segmentation on: {} and {}'.format(niiGzFile, stripFile))
        try:
            fast(stripFile, dstFilePath)
            logging.info('Saved FAST Segmentation results: {}'.format(dstFilePath))
        except RuntimeError:
            logging.warning('Failed on: {}'.format(niiGzFile))

Platform details:

Output:

strip file:  /tmp/tmplb2q897b/12_dzne_flair_1iso_strip.nii.gz
12_mprage_1iso
/tmp/tmplb2q897b/12_mprage_1iso

FileNotFoundError: No such file or directory '/home/einspaennere/Documents/GitHub/mri_qc_pipeline/12_mprage_1iso_seg.nii.gz' for output 'tissue_class_map' of a FAST interface

Execution environment

  • Win11
  • WSL Ubuntu 20.04
  • VSCode WSL Remote
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

1 participant