Hello,
I wanted to implement Brain Extraction (bet) with cwl but I have encountered with this error that I cannot do anything to solve it. I would appreciate if you can kindly help me with it.
Bet commandline must be something like this: bet and it will have two outputs if one add the ‘-m’, too.
My code in bet.cwl is:
___________________________________________
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool
baseCommand: bet
inputs:
rao:
type: File
out:
type: string
flagmi:
type: boolean
inputBinding:
prefix: -m
outputs:
- id: bet_output_mask
type: File
format: edam:format_3989
- id: bet_output_mask1
type: File
format: edam:format_3989
$namespaces:
edam: http://edamontology.org/
$schemas:
- http://edamontology.org/EDAM_1.18.owl
___________________________________________
And I have this file as bet-job.yml :
rao:
class: File
location: STRUCT.nii.gz
format: http://edamontology.org/edam:format_3989
out: STRUCT_brain.nii.gz
flagmi: true
_________________
The answer I get is:
----------------------------
/miniconda3/envs/onto38/bin/cwl-runner 3.1.20210628163208
INFO Resolved 'bet1.cwl' to 'file:///home/ssaneei/Documents/cwl/example/bet/bet1.cwl'
INFO [job bet1.cwl] /tmp/t1q57sld$ bet \
-m
Usage: bet <input> <output> [options]
Main bet2 options:
-o generate brain surface outline overlaid onto original image
-m generate binary brain mask
-s generate approximate skull image
-n don't generate segmented brain image output
-f <f> fractional intensity threshold (0->1); default=0.5; smaller values give larger brain outline estimates
-g <g> vertical gradient in fractional intensity threshold (-1->1); default=0; positive values give larger brain outline at bottom, smaller at top
-r <r> head radius (mm not voxels); initial surface sphere is set to half of this
-c <x y z> centre-of-gravity (voxels not mm) of initial mesh surface.
-t apply thresholding to segmented brain image and mask
-e generates brain surface as mesh in .vtk format
Variations on default bet2 functionality (mutually exclusive options):
(default) just run bet2
-R robust brain centre estimation (iterates BET several times)
-S eye & optic nerve cleanup (can be useful in SIENA - disables -o option)
-B bias field & neck cleanup (can be useful in SIENA)
-Z improve BET if FOV is very small in Z (by temporarily padding end slices)
-F apply to 4D FMRI data (uses -f 0.3 and dilates brain mask slightly)
-A run bet2 and then betsurf to get additional skull and scalp surfaces (includes registrations)
-A2 <T2> as with -A, when also feeding in non-brain-extracted T2 (includes registrations)
Miscellaneous options:
-v verbose (switch on diagnostic messages)
-h display this help, then exits
-d debug (don't delete temporary intermediate images)
ERROR [job bet1.cwl] Job error:
Error validating output record. * the `bet_output_mask` field is not valid because
is not a dict
* the `bet_output_mask1` field is not valid because
is not a dict
in {
"bet_output_mask": null,
"bet_output_mask1": null
}
WARNING [job bet1.cwl] completed permanentFail
{}
WARNING Final process status is permanentFail
--------------------------------------------------------------------