[caret-users] algorithm args backwards in caret_command?

John Harwell john at brainvis.wustl.edu
Tue Oct 14 09:13:43 CDT 2008


Baylis,

You are right, the parameters are being read in reverse.

The problem involves the way the compiler processing arguments to a  
function.   When calling a function, the compiler processes the  
arguments from last to first.  So, if "function(a(), b(), c())" is  
called, the compiler calls c() then b() and then a() which explains  
the behavior you are seeing.

If you need an updated caret_command, let know which operating system  
you are using.

-----------------------------------
John Harwell
john at brainvis.wustl.edu

Department of Anatomy and Neurobiology
Washington University School of Medicine
660 S. Euclid Ave   Box 8108
Saint Louis, MO 63110




On Oct 13, 2008, at 5:30 PM, Baylis Shanks wrote:

>
> Only the algorithm-specific parameters (of which  
> METRIC_ENCLOSING_VOXEL has none) are reversed. caret_command -help- 
> full contains the text:
>
>         [-g   gaussian-neighbor-cube-size (mm)
>               sigma-norm
>               sigma-tang
>               norm below cutoff (mm)
>               norm above cutoff (mm)
>               tang-cutoff (mm)]
>
> So, one would expect that the command "caret_command -volume-map-to- 
> surface coord topo \"\" outfile METRIC_GAUSSIAN infile -g  
> not_a_number 1 1 1 1 1" would cause an error in the ostensible first  
> parameter, "gaussian-neighbor-cube-size". However, as detailed in my  
> trace below, actually the error is reported in parameter ""Gaussian  
> Tangent Cutoff".
>
> Similarly, if you put an invalid parameter in the second position  
> after -g, it should cause trouble with the parameter "sigma-norm",  
> but actually the error is reported in parameter "Gaussian Norm Above  
> Cutoff".
>
> Similarly if you put an invalid parameter in the last position after  
> -g.
>
> Similarly, if you look at the column comments for a Gaussian  
> algorithm-mapped metric file by using the "?" button in D/C, it  
> seems like it read the algorithm-specific parameters in backwards.
>
> sorry for being unclear before,
>  thanks, bayle
>
>
>
>
>
> ----------------------------------------
>> Date: Mon, 13 Oct 2008 09:41:42 -0500
>> From: donna at brainvis.wustl.edu
>> To: caret-users at brainvis.wustl.edu
>> Subject: Re: [caret-users] algorithm args backwards in caret_command?
>>
>> Hi Bayle,
>>
>> This command worked just fine for me:
>>
>> caret_command -volume-map-to-surface test.scale.coord test.topo ""
>> test.out.metric METRIC_ENCLOSING_VOXEL test.nii
>>
>> That is, I didn't get the errors you cite below; however, I did get  
>> the
>> patchiness described in your other message (see capture).
>>
>> This usage matches my help output for this feature.
>>
>> Donna
>>
>> On 10/10/2008 08:43 PM, Baylis Shanks wrote:
>>> It seems like caret_command is reading in algorithm arguments  
>>> backwards (compared to the order they are listed in caret_command - 
>>> help-full):
>>>
>>>
>>> $ caret_command -volume-map-to-surface coord topo \"\" outfile  
>>> METRIC_GAUSSIAN infile -g not_a_number 1 1 1 1 1
>>>
>>> VOLUME MAP TO SURFACE ERROR: Error converting parameter named  
>>> "Gaussian Tangent Cutoff" with value "not_a_number" to a float
>>>
>>> bshanks at bshanks-salk:~/aba/niis_layer$ caret_command -volume-map- 
>>> to-surface coord topo \"\" outfile METRIC_GAUSSIAN infile -g 1  
>>> not_a_number 1 1 1 1
>>>
>>> VOLUME MAP TO SURFACE ERROR: Error converting parameter named  
>>> "Gaussian Norm Above Cutoff" with value "not_a_number" to a float
>>>
>>> bshanks at bshanks-salk:~/aba/niis_layer$ caret_command -volume-map- 
>>> to-surface coord topo \"\" outfile METRIC_GAUSSIAN infile -g 1 1 1  
>>> 1 1 not_a_number
>>>
>>> VOLUME MAP TO SURFACE ERROR: Error converting parameter named  
>>> "Guassian Neighbor Cube Size (mm)" with value "not_a_number" to a  
>>> float
>>>
>>>
>>>
>>> this isn't a big problem since you can just put the args in  
>>> backwards, but just fyi
>>>
>>> thanks,
>>>  bayle
>>> _________________________________________________________________
>>> Stay up to date on your PC, the Web, and your mobile phone with  
>>> Windows Live.
>>> http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/
>>> _______________________________________________
>>> caret-users mailing list
>>> caret-users at brainvis.wustl.edu
>>> http://brainvis.wustl.edu/mailman/listinfo/caret-users
>>>
>>
>
> _________________________________________________________________
> See how Windows Mobile brings your life together—at home, work, or  
> on the go.
> http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/
> _______________________________________________
> caret-users mailing list
> caret-users at brainvis.wustl.edu
> http://brainvis.wustl.edu/mailman/listinfo/caret-users
>




More information about the caret-users mailing list