[caret-users] preborder script

Donna Dierker donna at brainvis.wustl.edu
Tue Nov 10 10:25:51 CST 2009


On 11/10/2009 09:12 AM, Taosheng Liu wrote:
> Again, thanks for clarification, Donna. So you mean you're a relative 
> newbie to shell scripting? I can't believe you wrote this (very nice) 
> monster script ;)
I never said I was a newbie (been doing this for over 15 years); the 
"me, too" referred mostly to the trial and error comment.  (But just 
because I've been doing this for years doesn't mean I know much about it.)

>
> I just noticed there's a date on the GUI window. On mine it says Nov. 
> 2008. So I downloaded your caret_command and put in my 
> /usr/local/caret/bin_linux/. Is that all's needed? I mean I didn't 
> update other parts of caret (the GUI still says Nov. 2008 if I ran 
> caret5).  But it doesn't complain about -threshold option any more so 
> the script proceeded and generated the html files -- very cool. I 
> guess I'm a bit surprised that it worked-- isn't linux binary very 
> distro-dependent (I'm running Ubuntu 8.1 64 bit)?
>
> Before I bother your with how to read those output (sorry), there's 
> one little issue: the last line in the draw_landmarks function give me 
> an warning like this:
> Code:
>   caret_command -surface-border-landmark-identification $SPACE 
> $VOLUME_ANATOMY $FIDUCIAL $INFLATED $VINFLATED $ELLIPSOID $TOPO 
> $GEOGRAPHY_PAINT $GEOGRAPHY_PAINT Geography $SHAPE Depth $AREACOLOR 
> $AREACOLOR $VOCAB $VOCAB "" $OUTBORDERPROJ "" $BORDERCOLOR
>
> output:
> Color ??? specified multiple times with same color components.
> Color SUL specified multiple times with same color components.
This is normal and a good sign.
>
> Things seem to work ok, but in the second half of the script there're 
> a lot of warning/error in calling caret_command -show-scene :
>
> SHOW SCENE WARNING: Shape File has the following duplicate column names:
>    Folding (Mean Curvature)
Ignore.
>
> SHOW SCENE ERROR: Border color "???" not found.
>
> What's this ??? stuff, any suggestions? 
This suggests you don't have the latest/greatest bordercolor file.  
Download this:

http://brainmap.wustl.edu/pub/donna/FREESURFER/SCRIPTS/2009_10/PALS_B12.LR.zip
login pub
password download

It contains not only the bordercolor file, but also the atlas target 
dataset, which you will need for the postborder.sh script.  The template 
scenes and border_color_key.jpg also were moved into this zip.

It unpacks into a PALS_B12.LR atlas target directory, which I place in 
the same directory where my Freesurfer subject directories are located.
> I tried to decipher it but couldn't (that 
> -surface-border-landmark-identification command is the longest command 
> line code I've seen).
Oh, they get much longer than that. ;-)
>
> --ts
>
>
>
> Donna Dierker wrote:
>> On 11/09/2009 01:29 PM, Taosheng Liu wrote:
>>   
>>> Thanks, Donna.  I downloaded your new files. I have specific questions 
>>> below but first I want to ask a conceptual question: is everything 
>>> after border variability for just checking and displaying the results? 
>>> the actual work has been done in the main loop (import, resample, 
>>> generate_depth, draw_landmarks) -- that's my understanding. Is this 
>>> correct?
>>>     
>> Correct:  Border variability and check scenes is QA.  The scenes are 
>> handy not only for looking at the borders, but actually doing the update.
>>   
>>> I saw you added a DATA_DIR, and I assume it could be any directory as 
>>> long as all those files in the code download directory are there?  
>>> That's what I did. I still have a few problems
>>>
>>> 1) I got this error on caret_command -surface-border-projection
>>> SURFACE BORDER PROJECTION ERROR: Human.FS015.L.LANDMARKS.bvo.border 
>>> does not exist.
>>>
>>> But I suspect it's actually cased by the previous command not 
>>> finishing correctly:
>>>
>>> caret_command -surface-border-variability $BORDER_IN $TARGET_BORDER 
>>> $BORDER_OUT -threshold $THRESHOLD -border-report > $REPORT
>>>
>>> If I type the above in a terminal, the help doesn't mention anything 
>>> about -threshold option. And if I ran this command in the terminal I got
>>>
>>> SURFACE BORDER VARIABILITY ERROR: Unrecognized parameter: -threshold
>>>
>>> Does that mean I'm running an older version of Caret? I'm running ver 
>>> 5.61 (from the GUI: Help->About Caret)
>>>     
>> This is my guess as well.  I'm running version 5.612.  The threshold was 
>> added in January 2009, so if the date in your Caret main window header 
>> bar is earlier than that, then you need a newer version.
>>
>> I have copied my Linux caret_command to the same directory where you 
>> have been getting the scripts.  You can get a new version there.  (John 
>> just made a change to the auto-landmarks last Thursday, and I doubt it's 
>> on our regular download site yet.)
>>   
>>> 2) It seems the for loop:
>>> for HEM_FLAG in "L R"
>>>
>>> should be
>>>
>>> for HEM_FLAG in L R
>>>     
>> Correct.  I have made that change in two places.
>>   
>>> On my machine HEM_FLAG becomes "L R". Again, I don't know much about 
>>> shell scripting, I find out this by trial and error.
>>>     
>> Me, too, ts.  Me, too.
>>   
>>> --ts
>>>
>>>
>>>
>>> Donna Dierker wrote:
>>>     
>>>> Tis lovely.
>>>>
>>>> You might try downloading and running the script again.  Save your edits 
>>>> and do a diff between the newly downloaded and your version.  I made 
>>>> several tweaks to the border variability and scenes stuff.  There are 
>>>> more files in the download directory that you'll need to make that stuff 
>>>> work (e.g., template scenes).
>>>>
>>>> On 11/06/2009 02:34 PM, Taosheng Liu wrote:
>>>>   
>>>>       
>>>>> Hi Donna,
>>>>>   Yes, changing to bash fixed that syntax issue. Now I know better 
>>>>> about the volume normalization stuff. It does work quite well. And 
>>>>> thanks for clarifying the code about the midthickness file. I 
>>>>> understand why it's there now.  I think the reslicing worked for me. I 
>>>>> followed the instruction and here's a screen shot when viewing the 
>>>>> volume and surface. This is good, right?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> I've been running the script up until the commented-out "exit" before  
>>>>> the computer border variability. I tried to keep running it  but now I 
>>>>> get this error:
>>>>>
>>>>>  SURFACE BORDER PROJECTION ERROR: Human.FS015.R.LANDMARKS.bvo.border 
>>>>> does not exist
>>>>>
>>>>> code:
>>>>>
>>>>> caret_command -surface-border-projection $FIDUCIAL $TOPO $BORDER_OUT 
>>>>> "$BORDER_OUT"proj
>>>>>
>>>>> I think this caused subsequent errors which I'm not bothering you now. 
>>>>> Also, can you tell me the purpose of this border variability stuff?  
>>>>> It's not in the tutorial of how to do it manually, is it?
>>>>>
>>>>> Thank you again very much,
>>>>>
>>>>> --ts
>>>>>
>>>>>
>>>>> Donna Dierker wrote:
>>>>>     
>>>>>         
>>>>>> Hi ts,
>>>>>>
>>>>>> See inline replies below.
>>>>>>
>>>>>> Donna
>>>>>>
>>>>>> On 11/04/2009 06:13 PM, matt at ma-tea.com wrote:
>>>>>>   
>>>>>>       
>>>>>>           
>>>>>>> The default shell in Ubuntu is Dash, which is not quite as full 
>>>>>>> featured as Bash.  I recommend you either remove the == or change the 
>>>>>>> shell interpreter to /bin/bash on the first line of the script.
>>>>>>>
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>> Thanks, Matt -- I changed the shell to bash in both the preborder.sh and 
>>>>>> postborder.sh scripts.
>>>>>>   
>>>>>>       
>>>>>>           
>>>>>>> Peace,
>>>>>>>
>>>>>>>  
>>>>>>>
>>>>>>> Matt.
>>>>>>>
>>>>>>>  
>>>>>>>
>>>>>>> ------------------------------------------------------------------------
>>>>>>>
>>>>>>> *From:* caret-users-bounces at brainvis.wustl.edu 
>>>>>>> [mailto:caret-users-bounces at brainvis.wustl.edu] *On Behalf Of 
>>>>>>> *Taosheng Liu
>>>>>>> *Sent:* Wednesday, November 04, 2009 5:09 PM
>>>>>>> *To:* Caret, SureFit, and SuMS software users
>>>>>>> *Subject:* Re: [caret-users] preborder script
>>>>>>>
>>>>>>>  
>>>>>>>
>>>>>>> So this imgreg is like magic then. I can imagine after normalizing the 
>>>>>>> origin is close to AC. But how does it ensure AC-PC alignment? I take 
>>>>>>> you mean if subject's head is rotated it'll be rotated back so that 
>>>>>>> AC-PC line is on the anterior-posterior axis? Does it automatically 
>>>>>>> figure out where AC and PC is in an individual brain? I'm just curious.
>>>>>>>
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>> Yes, if the volume isn't rotated too much off AC-PC line.  I've seen 
>>>>>> both imgreg and flirt have trouble if the chin is rotated too far up or 
>>>>>> down.
>>>>>>
>>>>>> See the flirt papers for details on how it works:
>>>>>>
>>>>>> http://www.fmrib.ox.ac.uk/analysis/research/flirt
>>>>>>
>>>>>> SPM also does this (i.e., first pass affine transform before applying 
>>>>>> nonlinear warps).  It's so common that no one thinks of it as magic 
>>>>>> anymore, but if you had to do this by hand before such tools were 
>>>>>> common, you appreciate the magic. ;-)
>>>>>>
>>>>>>   
>>>>>>       
>>>>>>           
>>>>>>> This LPI stuff is confusing me a bit. Are you basically reorienting 
>>>>>>> the volume data?
>>>>>>>
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>> Precisely.  In AFNI parlance, I'm axializing it.  If you don't do this, 
>>>>>> and you try applying talairach.xfm to the orig.mgz, your result is 
>>>>>> upside down, flipped, etc.
>>>>>>   
>>>>>>       
>>>>>>           
>>>>>>> I did download your template and it ran without error, but how can I 
>>>>>>> know if the result is correct?
>>>>>>>
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>> See this page:
>>>>>>
>>>>>> http://brainvis.wustl.edu/help/pals_volume_normalization/spm5_normalization_pals.html
>>>>>>
>>>>>> Scroll down to "Check Alignment between Normalized Volume and Surface".  
>>>>>> You should already have a spec file with both the midthickness and 
>>>>>> anatomy volume in it.  If the surface and volume align nicely, all is well.
>>>>>>
>>>>>>   
>>>>>>       
>>>>>>           
>>>>>>> I pasted some output as you requested at the end of this message.
>>>>>>>
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>> I haven't digested it fully, but some things encourage me enough to 
>>>>>> continue our trials with the current TEMPLATE.LPI.nii.
>>>>>>   
>>>>>>       
>>>>>>           
>>>>>>> I also read the mri_convert help; there is a big paragraph at then end 
>>>>>>> about orientation string. Is that what you want?
>>>>>>>
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>> The big paragraph that sounds scary is not applicable to what we are 
>>>>>> doing.  (That one is warning you not to try to fix an orientation 
>>>>>> problem by patching the header, when what you really want is something 
>>>>>> that reslices/axializes.)
>>>>>>
>>>>>> We are simply reslicing (-rl) to get the volume ready to apply 
>>>>>> talairach.xfm, because we need it for auto-landmarks.
>>>>>>   
>>>>>>       
>>>>>>           
>>>>>>> I guess I'm not sure why reslice if reorienting is what's needed.
>>>>>>>
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>> Try this step without doing so, and observe the upside down/flipped output:
>>>>>>
>>>>>>   $FREESURFER_BIN_DIR/mri_convert orig.LPI.nii --apply_transform 
>>>>>> transforms/talairach.xfm -oc 0 0 0 orig.mni.nii
>>>>>>
>>>>>> This would be evident when checking the volume-surface alignment in the 
>>>>>> step above.
>>>>>>   
>>>>>>       
>>>>>>           
>>>>>>> At the risk of sounding too persistent. It seems you didn't use 
>>>>>>> $CASE.$HEM_FLAG.Midthickness.coord to generate the Caret fiducial. It 
>>>>>>> seems you apply Tailarach to FreeSurfer's pial and white surface to 
>>>>>>> get them into MNI, and then average the two to get midcortex, and then 
>>>>>>> applied the MIN-to-711 transform (on lines 144-151). So there's no 
>>>>>>> need to generate the mid-cortex surface in the native space, it seems. 
>>>>>>> I searched the string "Midthickness_orig" and there's only one 
>>>>>>> occurrence during it's generation (line 140). Maybe I didn't 
>>>>>>> understand the script?
>>>>>>>
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>> "Someone has been reading using the Source again, Luke." --Bob Cox, 
>>>>>> 12/19/2003, AFNI message board
>>>>>>
>>>>>> Touche.  You got me.  We don't really use 
>>>>>> $CASE.$HEM_FLAG.Midthickness.coord to generate the Caret fiducial.  Some 
>>>>>> folks, however, like having a midthickness representation in native 
>>>>>> space, native mesh.  They might do mysterious things with it to further 
>>>>>> their independent studies using FSL, matlab, and other tools.
>>>>>>
>>>>>> It's worth clarifying native space vs native mesh:
>>>>>>
>>>>>>     * By native space, I mean before transforming the volume/surface 
>>>>>> into MNI or 711-2B.  This is a linear transform.
>>>>>>
>>>>>>     * By native mesh, I mean on Freesurfer's original surface mesh -- 
>>>>>> usually 150k nodes or so, as opposed to the 73730-node PALS_B12 standard 
>>>>>> mesh.
>>>>>>
>>>>>> It's possible to have all four possiblilities:  native space, native 
>>>>>> mesh; native space, PALS mesh; atlas space, native mesh; atlas space, 
>>>>>> PALS mesh.  And since we have both MNI and 711-2B, we have multiple 
>>>>>> spaces.  So many ways to be confused!
>>>>>>   
>>>>>>       
>>>>>>           
>>>>>>> Lastly, I have to study a bit about the if statement. I found if I 
>>>>>>> change the == to = it worked. Maybe I have a different shell? I'm 
>>>>>>> running Linux (Ubuntu 8.10) so it's not due to mucking up from 
>>>>>>> Windows. I tried to look it up online but have seen both versions in 
>>>>>>> various tutorials... weird.
>>>>>>>
>>>>>>> Here's out put from mri_info:
>>>>>>>
>>>>>>> $ mri_info orig.mgz
>>>>>>> Volume information for orig.mgz
>>>>>>>           type: MGH
>>>>>>>     dimensions: 256 x 256 x 256
>>>>>>>    voxel sizes: 1.0000, 1.0000, 1.0000
>>>>>>>           type: UCHAR (0)
>>>>>>>            fov: 256.000
>>>>>>>            dof: 0
>>>>>>>         xstart: -128.0, xend: 128.0
>>>>>>>         ystart: -128.0, yend: 128.0
>>>>>>>         zstart: -128.0, zend: 128.0
>>>>>>>             TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 
>>>>>>> 0.00 degrees
>>>>>>>        nframes: 1
>>>>>>> ras xform present
>>>>>>>     xform info: x_r =  -1.0000, y_r =   0.0000, z_r =   0.0000, c_r 
>>>>>>> =     6.3534
>>>>>>>               : x_a =   0.0000, y_a =   0.0000, z_a =   1.0000, c_a 
>>>>>>> =    43.9880
>>>>>>>               : x_s =   0.0000, y_s =  -1.0000, z_s =   0.0000, c_s 
>>>>>>> =   -33.5490
>>>>>>>
>>>>>>> talairach xfm : 
>>>>>>> /home/tsliu/Desktop/Caret_test/FS015/mri/transforms/talairach.xfm
>>>>>>> Orientation   : LIA
>>>>>>> Primary Slice Direction: coronal
>>>>>>>
>>>>>>> voxel to ras transform:
>>>>>>>                -1.0000   0.0000   0.0000   134.3534
>>>>>>>                 0.0000   0.0000   1.0000   -84.0120
>>>>>>>                 0.0000  -1.0000   0.0000    94.4510
>>>>>>>                 0.0000   0.0000   0.0000     1.0000
>>>>>>>
>>>>>>> voxel-to-ras determinant -1
>>>>>>>
>>>>>>> ras to voxel transform:
>>>>>>>                -1.0000   0.0000   0.0000   134.3534
>>>>>>>                -0.0000  -0.0000  -1.0000    94.4510
>>>>>>>                -0.0000   1.0000  -0.0000    84.0120
>>>>>>>                 0.0000   0.0000   0.0000     1.0000
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Donna Dierker wrote:
>>>>>>>
>>>>>>> On 11/04/2009 11:44 AM, Taosheng Liu wrote:
>>>>>>>   
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>>>> Hi Donna,
>>>>>>>>   After some discussion/soul-searching we think we can/should use your 
>>>>>>>> script. I've been studying your preborder script--very nice script, 
>>>>>>>> but my brain hurts :).  I tried the main loop before the computing 
>>>>>>>> border variability stuff. It actually runs, for the most part. And I 
>>>>>>>> have a few questions.
>>>>>>>>  
>>>>>>>> 1. This is a conceptual one. My understanding is that you take FS 
>>>>>>>> surface, apply the auto-Talairach transform generated during 
>>>>>>>> recon-all, and then apply the MNI-to-711 transform to get the surface 
>>>>>>>> in Caret, correct?  As far as I understand, both transforms are 
>>>>>>>> affine? This is important as when we read the atlas to Matlab we want 
>>>>>>>> to reverse those two transforms.
>>>>>>>>     
>>>>>>>>       
>>>>>>>>           
>>>>>>>>               
>>>>>>> Yes.  Both matrices are 12-parameter affine transforms, both invertible.
>>>>>>>   
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>>>> 2. I thought Caret surface requires AC to be the origin. 
>>>>>>>>     
>>>>>>>>       
>>>>>>>>           
>>>>>>>>               
>>>>>>> This was partly important for segmentation to work properly, which you 
>>>>>>> don't need Caret to do.  It was also important for template flattening 
>>>>>>> cuts and the compressed medial wall to be centered properly, but you're 
>>>>>>> not flattening, so this isn't important.
>>>>>>>  
>>>>>>> Still, it's important for drawing borders, but see next answer.
>>>>>>>   
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>>>> Where is this set in the script?  
>>>>>>>>     
>>>>>>>>       
>>>>>>>>           
>>>>>>>>               
>>>>>>> When you apply the talairach.xfm, you place the origin close enough to 
>>>>>>> the AC to make auto-landmarks work properly.  You also ensure AC-PC 
>>>>>>> alignment, which is also important for drawing borders.
>>>>>>>   
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>>>> I imagine there has to be some manual intervention to define AC.
>>>>>>>>     
>>>>>>>>       
>>>>>>>>           
>>>>>>>>               
>>>>>>> No.  The magic here is in talairach_avi, the Freesurfer code that calls 
>>>>>>> Avi Snyder's imgreg, which is like FSL's flirt.
>>>>>>>   
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>>>> 3. This might be related to the two questions above, but there seems 
>>>>>>>> to be another transform, LPI in the script. What does it do? The 
>>>>>>>> script gives me an error on line 126; it says it can't find the file 
>>>>>>>> TEMPLATE.LPI.nii. Where can I locate this file (and how to generate 
>>>>>>>> it)? This seemed to cause problem later in auto landmark 
>>>>>>>> drawing--seems it require the volume file.
>>>>>>>>     
>>>>>>>>       
>>>>>>>>           
>>>>>>>>               
>>>>>>> Sorry about that.  Early adopter syndrome.  This was needed to tell 
>>>>>>> mri_convert how to reslice the volume, so that it is in an orientation 
>>>>>>> that talairach.xfm expects.  (While Freesurfer surfaces are in LPI 
>>>>>>> orientation, the volume I was working on was RSP.  When we use those 
>>>>>>> codes, we main the same thing as the AFNI folks, i.e., 
>>>>>>> http://brainmap.wustl.edu/OLD/SureFit/orient.html, which might not match 
>>>>>>> what the Freesurfer folks mean.)  There might be a more straightforward 
>>>>>>> way of accomplishing this, but I wasn't able to figure it out from the 
>>>>>>> mri_convert usage, and simply reslicing to LPI worked.  So I did that.
>>>>>>>  
>>>>>>> The question is whether my TEMPLATE.LPI.nii will work for your volume.  
>>>>>>> I don't know.  I'll need to run it through a few more of my own subjects 
>>>>>>> before I have a good clue about that.  Meanwhile, you're welcome to try 
>>>>>>> mine:
>>>>>>>  
>>>>>>> http://brainmap.wustl.edu/pub/donna/FREESURFER/SCRIPTS/2009_10/TEMPLATE.LPI.nii
>>>>>>> login pub
>>>>>>> password download
>>>>>>>  
>>>>>>> One thing that would help me make a prediction is if you sent me the 
>>>>>>> output of this command (executed from within your subject's mri directory):
>>>>>>>  
>>>>>>> mri_info orig.mgz
>>>>>>>   
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>>>> 4. what is the purpose of $CASE.$HEM_FLAG.Midthickness.coord? 
>>>>>>>>     
>>>>>>>>       
>>>>>>>>           
>>>>>>>>               
>>>>>>> It's the average of the white matter and pial surfaces in Freesurfer 
>>>>>>> mesh.  Later, it gets downsampled and/or affine transformed a couple of 
>>>>>>> different ways:  Once to translate from what I call "Freesurfer 
>>>>>>> coordinate space" (i.e., almost native, but translated so the origin is 
>>>>>>> roughly the midpoint along each axis, usually somewhere along the 
>>>>>>> midline under the corpus callossum, but above and behind the AC) to true 
>>>>>>> native space (origin where it was in the volume); second and third 
>>>>>>> transforms to MNI and 711-2B.  This becomes the Caret fiducial surface.
>>>>>>>   
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>>>> This file was generated on line 117-120, and later on line 140 was 
>>>>>>>> used to transform to $CASE.$HEM_FLAG.Midthickness_orig.coord (via an 
>>>>>>>> identity transform?) Neither seem to be used later in the script. I 
>>>>>>>> actually encountered an error on line 140:
>>>>>>>> Code:
>>>>>>>> $caret_command -surface-apply-transformation-matrix 
>>>>>>>> Human.FS015.L.Midthickness.coord Human.FS015.L.topo 
>>>>>>>> Human.FS015.L.Midthickness_orig.coord -matrix
>>>>>>>>  
>>>>>>>> Error:
>>>>>>>> SURFACE APPLY TRANSFORMATION MATRIX ERROR: Parameter named "Matrix 
>>>>>>>> value 4" is missing.
>>>>>>>>     
>>>>>>>>       
>>>>>>>>           
>>>>>>>>               
>>>>>>> This is because the TEMPLATE.LPI.nii file was missing, so orig.LPI.nii 
>>>>>>> didn't get generated, so the mri_info commands that populate the 
>>>>>>> translation offsets in the matrix don't get real values.  Putting 
>>>>>>> TEMPLATE.LPI.nii
>>>>>>>   
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>>>> 5. For some reason the if statement on line 171 is not recognized. I 
>>>>>>>> got an error:
>>>>>>>>  
>>>>>>>> [: 1: ==: unexpected operator
>>>>>>>>  
>>>>>>>> The code is pasted here:
>>>>>>>>  
>>>>>>>>   if [ "$HEMISPHERE" == "left" ]
>>>>>>>>   then
>>>>>>>>     COORD_TGT=$SPHERE_COORD_LEFT
>>>>>>>>     TOPO_TGT=$TOPO_LEFT
>>>>>>>>   else
>>>>>>>>     COORD_TGT=$SPHERE_COORD_RIGHT
>>>>>>>>     TOPO_TGT=$TOPO_RIGHT
>>>>>>>>   fi
>>>>>>>>  
>>>>>>>>  
>>>>>>>> This caused both left and right hemispheres using the right target 
>>>>>>>> sphere to generate the deformation map. I don't know much shell 
>>>>>>>> scripting and I don't know how to fix this (but I assume it worked for 
>>>>>>>> you?).
>>>>>>>>     
>>>>>>>>       
>>>>>>>>           
>>>>>>>>               
>>>>>>> Yes, it is working for me (mostly).  Did you by chance 
>>>>>>> display/cut/pasted lines from this script on Windows, thereby 
>>>>>>> introducing invisible carriage returns that confuse the shell?  On 
>>>>>>> Linux, you can rule this out by doing "cat preborder.sh | tr -d '\r' > A 
>>>>>>> ; mv A preborder.sh" and seeing if you have better luck.
>>>>>>>   
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>>>> 6. Just out of curiosity: why are the coord file names for the 
>>>>>>>> spherical target brain in Caret named differently? i.e., on line 31-32
>>>>>>>>  
>>>>>>>> SPHERE_COORD_LEFT=$MESH_DIR/Human.PALS.LEFT/Human.sphere_6.73730.coord
>>>>>>>> SPHERE_COORD_RIGHT=$MESH_DIR/Human.PALS.RIGHT/Human.PALS_B12.SPHERE.73730.coord
>>>>>>>>  
>>>>>>>> The topo files have the same name. Just want to understand it.
>>>>>>>>     
>>>>>>>>       
>>>>>>>>           
>>>>>>>>               
>>>>>>> I don't know.  A better question is why I'm not using these variables.  
>>>>>>> I probably should be.
>>>>>>>   
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>>>> Sorry for the long email.  Thanks very much for all the help.
>>>>>>>>  
>>>>>>>> --ts
>>>>>>>> ------------------------------------------------------------------------
>>>>>>>>  
>>>>>>>> _______________________________________________
>>>>>>>> caret-users mailing list
>>>>>>>> caret-users at brainvis.wustl.edu <mailto:caret-users at brainvis.wustl.edu>
>>>>>>>> http://brainvis.wustl.edu/mailman/listinfo/caret-users
>>>>>>>>   




More information about the caret-users mailing list