out_file error

23 views
Skip to first unread message

Yasin Yazıcı

unread,
Jul 9, 2014, 2:32:40 AM7/9/14
to nipy...@googlegroups.com
Hi

# fsl ChangeDataType
fsl_cdt
= pe.Node(interface = fsl.ChangeDataType(), name = 'fsl_ChangeDataType')
fsl_cdt
.inputs.output_datatype = 'int'
#fsl_cdt.inputs.out_file = 'brain_mask_int.nii.gz'

The partial code above raise an error as follows:
TraitError: The 'out_file' trait of a MathsOutput instance must be an existing file name, but a value of '/tmp/tmpszGGQm/bs_pipeline/fsl_ChangeDataType/brain_mask_chdt.nii.gz' <type 'str'> was specified.

As you can see from the partial code, I didn't specify the 'out_file'. The 'out_file' =brain_mask_chdt.nii.gz is its default name with the input brain_mask_nii.gz.
1-) sometimes it gives this error and sometimes does not even though I don't change the code. Why it behaves such a strange way?
2-) I want to specify output name but it gives the same error. Can't I use the 'out_file' instead of renaming the output with Rename() ?
3-) What is the difference between outputs.out_file and inputs.out_file?

P.S > I encountered the same error with the other functions.

Regards
Yasin

Satrajit Ghosh

unread,
Jul 9, 2014, 9:33:18 AM7/9/14
to nipy-user
hi yasin,

# fsl ChangeDataType
fsl_cdt
= pe.Node(interface = fsl.ChangeDataType(), name = 'fsl_ChangeDataType')
fsl_cdt
.inputs.output_datatype = 'int'
#fsl_cdt.inputs.out_file = 'brain_mask_int.nii.gz'

The partial code above raise an error as follows:
TraitError: The 'out_file' trait of a MathsOutput instance must be an existing file name, but a value of '/tmp/tmpszGGQm/bs_pipeline/fsl_ChangeDataType/brain_mask_chdt.nii.gz' <type 'str'> was specified.

As you can see from the partial code, I didn't specify the 'out_file'. The 'out_file' =brain_mask_chdt.nii.gz is its default name with the input brain_mask_nii.gz.
1-) sometimes it gives this error and sometimes does not even though I don't change the code. Why it behaves such a strange way?

since you are running these in /tmp (the default if workflow.base_dir or node.base_dir is not set), it's possible that your /tmp directory is full and the os is deleting files. or this could happen if you are running this on a cluster and did not set the base directory of the workflow.
 
2-) I want to specify output name but it gives the same error. Can't I use the 'out_file' instead of renaming the output with Rename() ?

for that interface you should be able to specify `out_file` as in your commented line.
 
3-) What is the difference between outputs.out_file and inputs.out_file?

the inputs.out_file allows the user to specify an output name, whereas the outputs.out_file checks for an existence of a generated out_file.
 
P.S > I encountered the same error with the other functions.

this might have to do with disk space issues. 

cheers,

satra
Reply all
Reply to author
Forward
0 new messages