Julia,
Okay, if I understand you correctly, deformed_RH_*.metric does NOT
contain a single column, but rather multiple columns for different
conditions for the same subject. Thus, you can't use this:
COL_ENTRIES="$COL_ENTRIES `basename $EACHCOL` 1"
... because the " 1" means grab the first column. I suggested this,
thinking you had only a single column in your metric file, which appears
to be not the case.
So, you need to get the column name exactly right, and evidently you
haven't.
Maybe instead you need:
for CONDITION in `ls /mrt/Visac/*Visac/stats/*Visac_fullGLM/c*.nii`
do
OUTFILE=my.$CONDITION.metric
CONDITION=`basename $CONDITION`
ENTRIES=""
for METRIC in `ls
/mrt/Visac/group_metrics/Visac_fullGLM/deformed_RH_*Visac_beta.metric`
do
ENTRIES="$METRIC $CONDITION"
done
caret_command -metric-composite-identified-columns $OUTFILE $ENTRIES
done
Donna
On 03/31/2010 09:57 AM, Julia Bender wrote:
> Hi Donna,
>
> thanks for your help. `ls /mrt/Visac/*Visac/stats/*Visac_fullGLM/c*.nii`
> only specifies the conds =column names. The stat-values are stored in
> $CURRDIR/deformed_RH_*.metric files, one for each subject. So my code
> needs to take the names of the .nii files, find each of the so specified
> columns in each of the two deformed.metrics files, and combine them into
> one metric file. So I think what I need is 2 loops. I tried this:
>
> OUTFILE=my_composite.metric
> rm -rf $OUTFILE
> COL_ENTRIES=""
> MET_ENTRIES=""
>
> for EACHCOL in `ls /mrt/Visac/*Visac/stats/*Visac_fullGLM/c*.nii`
> do
> COL_ENTRIES="$COL_ENTRIES `basename $EACHCOL` 1"
> done
>
> for EACHMETRIC in `ls
> /mrt/Visac/group_metrics/Visac_fullGLM/deformed_RH_*Visac_beta.metric` do
> MET_ENTRIES="$MET_ENTRIES $EACHMETRIC 1"
> done
>
> caret_command -metric-composite-identified-columns $OUTFILE $EACHMETRIC
> $COL_ENTRIES
>
> I get: METRIC COMPOSITE IDENTIFIED COLUMNS ERROR: ERROR column name/number
> cCue_EndoLeft.nii not found in file deformed_RH_02Visac_beta.metric
>
> deformed_RH_02Visac_beta.metric looks the same as the file for subj 01 and
> is in the same folder. Any ideas what could be wrong?
>
> Also, what is the "1" at the end of the line for?
>
> Thanks a lot!!
>
> Julia
>
>
>
>> Julia,
>>
>> Here is the usage for this command:
>>
>> caret_command -metric-composite-identified-columns
>> <output-metric-file-name>
>> [input-metric-file-1 file-1-column]
>> ...
>> [input-metric-file-N file-2-column]
>>
>> Composite the selected columns from the input metric
>> files and place them into the output metric file.
>>
>> "column" is either the number of the column, which
>> starts at one, or the name of the column. If a
>> a name contains spaces, it must be enclosed in double
>> quotes. Name has priority over number.
>>
>> I'm not 100% certain, but I think file-1-column refers to what the
>>
> column is named in the input file, rather than what you want it to be
> named in the output file. So if there is just a single column in
> $EACHCOL, the simplest thing is to just specify 1 there, to indicate the
> first (and only) column.
>
>> I think I would do this, instead of what you have:
>>
>> OUTFILE=my_composite.metric
>> rm -rf $OUTFILE
>> COL_ENTRIES=""
>> for EACHCOL in `ls /mrt/Visac/*Visac/stats/*Visac_fullGLM/c*.nii` do
>> COL_ENTRIES="$COL_ENTRIES $EACHCOL 1"
>> done
>>
>> caret_command -metric-composite-identified-columns $OUTFILE $COL_ENTRIES
>>
>> Note that there should be only one caret_command, but it should specify
>>
> all four cols. All you need the loop for is to generate this part of
> the command:
>
>> [input-metric-file-1 file-1-column]
>> ...
>> [input-metric-file-N file-2-column]
>>
>> Donna
>>
>> On 03/30/2010 10:19 AM, Julia Bender wrote:
>>
>>> Hi,
>>> thanks for your help. I'm trying to composite four conds columns from two
>>> subjects' deformed-metric-files into one combined metric file:
>>> for EACHCOL in `ls /mrt/Visac/*Visac/stats/*Visac_fullGLM/c*.nii` (= my
>>>
> four conds files)
>
>>> do
>>> caret_command -metric-composite-identified-columns
>>>
> $CURRDIR/RH_`basename
>
>>> $EACHCOL .nii`.metric $CURRDIR/deformed_RH_*.metric `basename $EACHCOL
>>>
> .nii`
>
>>> done
>>> I get: "METRIC COMPOSITE IDENTIFIED COLUMNS ERROR: ERROR column
>>>
> name/number cCue_EndoLeft (=my first conds column) not found in file
> deformed_RH_01Visac_beta.metric"
>
>>> CURRDIR is the directory were the deformed-metric-files are. I have
>>>
> full
>
>>> permission on all files. In the deformed-metric-files the columns are
>>>
> named like this: tag-column-name 0 cCue_EndoLeft.nii[1]
>
>>> I understand that I need to specify either column name or number so
>>>
> that
>
>>> columns are combined correctly. I tried to do that with `basename $EACHCOL
>>> .nii` , which obviously doesn't work. Do you know how I can assign
>>>
> name/number in the loop?
>
>>> Thanks a lot!
>>> Julia
>>> Dipl. Psych. Julia Bender
>>> Humboldt Universität zu Berlin
>>> Mathematisch - Naturwissenschaftliche Fakultät II
>>> Institut für Psychologie, Abt. Klinische Psychologie
>>> Unter den Linden 6
>>> D-10099 Berlin
>>> _______________________________________________
>>> caret-users mailing list
>>> [email protected]
>>> http://brainvis.wustl.edu/mailman/listinfo/caret-users
>>>
>> _______________________________________________
>> caret-users mailing list
>> [email protected]
>> http://brainvis.wustl.edu/mailman/listinfo/caret-users
>>
>>
>
>
> Dipl. Psych. Julia Bender
> Humboldt Universität zu Berlin
> Mathematisch - Naturwissenschaftliche Fakultät II
> Institut für Psychologie, Abt. Klinische Psychologie
> Unter den Linden 6
> D-10099 Berlin
>
>
>
>
> _______________________________________________
> caret-users mailing list
> [email protected]
> http://brainvis.wustl.edu/mailman/listinfo/caret-users
>
_______________________________________________
caret-users mailing list
[email protected]
http://brainvis.wustl.edu/mailman/listinfo/caret-users