[Brains-users] Re: [Fwd: Hippocampal Traces on 6 healthy controls.]

Hans Johnson hans-johnson at psychiatry.uiowa.edu
Fri Jun 3 09:03:35 PDT 2005


Steve,

If I understand your problem correctly, this would also be trivial in
BRAINS. Just off the top of my head, here is what the code may look like
in the simplest terms:


====================================================================================
## This script assumes that you are in the directory with all the roi's
##
proc CreateCodeImageFromROI { DirectoryName } {
  foreach roiFile [ glob ${DirectoryName}/*.xroi ] {
    set temproi [ b2 load roi $roiFile ]
    lappend myMasks [ b2 convert roi to mask $temproi ]
    #just to keep memory nice and clean, the roi is no longer needed
    b2 destroy roi $temproi
  }

  set myImage [ b2 convert mask-set to code-image $myMasks ]
#Again just to keep memory nice and clean, the Masks are no longer
  needed
  foreach delMask $myMasks {
     b2 destroy mask $delMask
  }
  return $myImage
}

set imageToDelete [ CreateCodeImageFromROI
/raid1/structural/MR/testpat/testscan/10_ACPC/hjohnson ]
b2 save image $myImage MyOutputCodeImage.hdr strictAnalyze75 data-type=
unsigned-8bit
b2 destroy image $imageToDelete


====================================================================================

I have run this script on a set of cerebellar ROI's (a set of coplanar
contour ROIS). The resulting image is shown in the attached image.

Hans

On Jun 03, 2005 09:18 AM, Steve Pieper <pieper at bwh.harvard.edu> wrote:

> Hi -
> 
> Yesterday on the engineering tcon Bill Lorensen and Jim Miller said
> they
> have code to batch-convert contour ROIs into labelmaps -- this would
> be
> great to work on the files that Dartmouth generated with BRAINS.
> 
> Here's the background info from John West. He also told me that there
> is a transform file from Brains, but I don't have an example of that
> --
> John, can you provide them?
> 
> I'm cc'ing Hans Johnson from Iowa so he knows what's up... perhaps he 
> already has a program to do this? If not, maybe he'll want this
> feature
> too.
> 
> Best,
> Steve
> 
> 
> 
> -------- Original Message --------
> Subject: Hippocampal Traces on 6 healthy controls.
> Date: 3 May 2005 12:37:00 -0400
> From: John D. West <John.D.West at Dartmouth.EDU>
> To: "Steve Pieper" <pieper at bwh.harvard.edu>
> CC: Andrew J. Saykin <Andrew.J.Saykin at Dartmouth.EDU>
> 
> Hi Steve.
> 
> I just uploaded the hippocampal traces for our 6 HCs.  You can get to 
> the data from the Wiki.
> 
> Couple of things I should mentions. First, the traces were not made on
> the original SPGR. They were made on an SPGR realigned along the long
> axis of the hippocampus, and resampled to 1.01562 mm3 isotropic
> voxels.
>   We have these resampled images in analyze format if you need them.
> 
> Second, the point list in the files are x and y pixel coordinates. The
> .zroi file name itself tells you the z pixel coordinate.  The list of 
> points in each .zroi file is listed as follows:
> 
> the first entry is the # of coordinates x1,y1, x2, y2, etc. i.e. if 
> there are 4 points this number would be 8
> x1
> y1
> x2
> y2
> etc.
> header info which I have anonymized
> 
> If you need any other info on those files, please let me know.
> 
> Thanks.
> -John
> 



Hans Johnson
hans-johnson at uiowa.edu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CodeImageCerebellum.png
Type: image/png
Size: 66444 bytes
Desc: not available
Url : http://www.nitrc.org/pipermail/brains-users/attachments/20050603/eb226660/CodeImageCerebellum.png


More information about the Brains-users mailing list