3dBrickStat (Output needs to be a value rather than a file)

46 views
Skip to first unread message

sharad sikka

unread,
Aug 29, 2011, 4:53:14 PM8/29/11
to NiPy Users
Hi,
I am trying to write an interface for 3dBrickStat to execute the
command line below.

3dBrickStat -min -mask ${func_dir}/${rest}_pp_mask.nii.gz ${func_dir}/$
{rest}_pp.nii.gz

Here the output is a minimum value in the dataset.


so the definition of ThreedBrickStatOutputSpec would look like this?:

class ThreedBrickStatOutputSpec(AFNITraitedSpec):
min_val = traits.Float(desc = 'output')


I am not so sure. I am looking in your documentation in the mean while

Thanks in advance,
sharad

Satrajit Ghosh

unread,
Aug 29, 2011, 5:15:12 PM8/29/11
to nipy...@googlegroups.com
traits.Bool

cheers,

satra

sharad sikka

unread,
Aug 30, 2011, 6:29:42 PM8/30/11
to NiPy Users
I did not follow
I guess traits.Bool should be for ThreedBrickStatInputSpec

the input spec that I wrote:

class ThreedBrickStatInputSpec(AFNITraitedSpec):
in_file = File(desc = 'input file to 3dmaskave',
argstr = '%s',
position = -1,
mandatory = True,
exists = True)
min_val = traits.Bool(desc = 'output min val',
argstr = '',
position = 3,
mandatory = True)
mask = File(desc = '-mask dset = use dset as mask to include/
exclude voxe
ls',
argstr = '-mask %s',
position = 2)

min = traits.Bool(desc = 'print the minimum value in dataset',
argstr = '-min',
position = 1)


The output spec :

class ThreedBrickStatOutputSpec(AFNITraitedSpec):
min_val = traits.Float(desc = 'output')

class ThreedBrickStat(AFNICommand):
"""
For complete details, see the `3dmaskave Documentation.
<http://afni.nimh.nih.gov/pub/dist/doc/program_help/3dmaskave.html>`_
"""

_cmd = '3dBrickStat'
input_spec = ThreedMaskaveInputSpec
output_spec = ThreedMaskaveOutputSpec

def _list_outputs(self):
outputs = self.output_spec().get()
outputs['min_val'] =??????
return outputs

I am not able to figure out "outputs['min_val'] = ?" ,

Thanks,
sharad

Satrajit Ghosh

unread,
Aug 31, 2011, 2:05:41 AM8/31/11
to nipy...@googlegroups.com
hi sharad,

i completely misread your initial question and thus referred to the input side. i'm assuming that the output is on stdout? if so take a look at the code for FSL.ImageStats

cheers,

satra

sharad sikka

unread,
Aug 31, 2011, 11:06:12 AM8/31/11
to NiPy Users
yes , to stdout.
Thanks it worked. But Its not trivial to figure out whats going on. I
guess I would have to dive in.

Thanks Again,
sharad
Reply all
Reply to author
Forward
0 new messages