[Insight-users] Writing Analyze file and specifying header properties

Sara Rolfe smrolfe at u.washington.edu
Tue Apr 3 17:45:52 EDT 2012


Thanks for your response.  I am working with a 3D image, but it is  
stored as a series of 2D BMPs.  It's the final 3D file that I need to  
write in Analyze file format.

I understand that I can simply mirror my image to get the output I  
need and that this will be specific to my application.  However, I  
also need to set the Analyze header fields to the correct values, and  
this is what I'm not seeing how to do.  I would expect that there's a  
way to change the default values when writing a new Analyze image.

Thanks,
Sara


On Apr 3, 2012, at 2:17 PM, Johnson, Hans J wrote:

> The Analyze file format was never intended for 2D images.  The  
> meaning of
> "CORONAL" "TRANSVERSE" in the Analyze file format are insufficient to
> properly describe physical space orientation.
>
> In a 3D image there are 8 different possible definitions of  
> "CORONAL", and
> each would give a different physical space representation.  There is  
> no
> good default, so it must be left up to the user to make their own  
> problem
> specific solution.
>
> Hans
> --
> Hans J. Johnson, Ph.D.
> hans-johnson at uiowa.edu
> Assistant Professor of Psychiatry
> University of Iowa Carver College of Medicine
> W278 GH, 200 Hawkins Drive
>
> Iowa City, Iowa 52242
> Phone:  319-353-8587
>
>
>
>
>
>
>
> -----Original Message-----
> From: Sara Rolfe <smrolfe at u.washington.edu>
> Date: Tue, 3 Apr 2012 14:09:30 -0700
> To: Kent Williams <nkwmailinglists at gmail.com>
> Cc: "insight-users at itk.org Users" <insight-users at itk.org>
> Subject: Re: [Insight-users] Writing Analyze file and specifying  
> header
> properties
>
> It seems like it would be easiest to manually reverse the pixel rows,
> but I'm not clear on how this would change the orientation in the
> image information.  Isn't this necessary to change the Analyze header
> orientation option to "CORONAL" instead of "TRANSVERSE", or am I
> missing something?
>
> If I use the OrientImageFilter on the reconstructed 3D volume I
> thought AnalyzeImageIO would get the new orientation from this image.
> Is this correct?  It is true that I'm not sure how to choose the
> correct orientation to get the output I need.
>
> I am wondering if there is an easier way to accomplish this.  Other
> image readers allow a stack of BMPs to be read into a 3D volume and
> let the user to input the orientation (eg Transverse or Coronal) and
> voxel resolution.  It seems strange that the ITK forces the user to
> use the default orientation (Transverse) and resolution.
>
> Thanks,
> Sara
>
> On Apr 3, 2012, at 1:48 PM, Kent Williams wrote:
>
>> The OrientImageFilter is 3D only.  The easiest thing for you to do if
>> your images are showing up left/right swapped when converted to
>> Analyze would be to manually reverse the pixel rows.
>>
>> I assume you're going from BMP->itk::Image<pixType,2>. If you're
>> assembling a bunch of BMP files into a 3D Volume, then the
>> OrientImageFilter might be the thing to use.  But for that to work
>> properly you'd have to know what the orientation for the image you're
>> constructing is.
>>
>> On Tue, Apr 3, 2012 at 3:16 PM, Sara Rolfe
>> <smrolfe at u.washington.edu> wrote:
>>> Hi Kent,
>>>
>>> Thanks, that makes sense.  Unfortunately I am stuck using the  
>>> Analyze
>>> format.
>>>
>>> Would I use the Orientation image filter that Saurabh mentioned to
>>> change
>>> the direction cosines?
>>>
>>> Thanks,
>>> Sara
>>>
>>>
>>> On Apr 3, 2012, at 10:45 AM, Kent Williams wrote:
>>>
>>>> When you read in the BMP file, the image orientation defaults to
>>>> identity.  You can change the Direction cosines for the image to
>>>> reflect what you want for the output image.  The ImageIO object  
>>>> that
>>>> does the actual writing uses the orientation/spacing/origin
>>>> information contained in the image that you're writing.
>>>>
>>>> I guess there's a reason you're using Analyze format, but I'd
>>>> recommend against it, as it's very limited, especially when it  
>>>> comes
>>>> to correct representation of orientation.
>>>>
>>>> On Mon, Apr 2, 2012 at 5:43 PM, Sara Rolfe
>>>> <smrolfe at u.washington.edu>
>>>> wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>> I would like to read a file of bmp images and write them as a
>>>>> 3DAnalyze
>>>>> image.  I have implemented this using the ImageSeriesReader.
>>>>> However,
>>>>> when
>>>>> the output is written as an Analyze volume, the default values for
>>>>> orientation and voxel resolution are incorrect.  This causes the
>>>>> output
>>>>> image to be mirrored.  I've not been able to find an explanation
>>>>> of how
>>>>> to
>>>>> set these properties and would appreciate help figuring this out.
>>>>>
>>>>> Thanks,
>>>>> Sara
>>>>>
>>>>>
>>>>> _____________________________________
>>>>> Powered by www.kitware.com
>>>>>
>>>>> Visit other Kitware open-source projects at
>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>> Kitware offers ITK Training Courses, for more information visit:
>>>>> http://www.kitware.com/products/protraining.php
>>>>>
>>>>> Please keep messages on-topic and check the ITK FAQ at:
>>>>> http://www.itk.org/Wiki/ITK_FAQ
>>>>>
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://www.itk.org/mailman/listinfo/insight-users
>>>
>>>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
>
> ________________________________
> Notice: This UI Health Care e-mail (including attachments) is  
> covered by the Electronic Communications Privacy Act, 18 U.S.C.  
> 2510-2521, is confidential and may be legally privileged.  If you  
> are not the intended recipient, you are hereby notified that any  
> retention, dissemination, distribution, or copying of this  
> communication is strictly prohibited.  Please reply to the sender  
> that you have received the message in error, then delete it.  Thank  
> you.
> ________________________________



More information about the Insight-users mailing list