[Insight-users] Interpolation Volume

Gupt adityargupta at gmail.com
Tue Dec 8 16:17:08 EST 2009


Hello Luis,

Using UpdateLargestPossibleRegion() didn't give me the error for one set of
slices but the mhd (raw and hdr) file created had errors. When I try to open
the volume using MRIcro, I get the error - 

Unknown image format, and file size smaller than described in 'Header
Information' panel.

I also tried using ITK SNAP but am unable to open the file.

When I re-run the program for a different set of slices, I get the error
described in my last post - "Largest possible region  does not fully contain
requested paste IO regionPaste IO region:..."

Thank you for your help.

Regards,
Gupt

Luis Ibanez wrote:
> 
> Hi Gupt,
> 
> This error is usually produced when you attempt to "reuse" a
> reader to load two images of different size, one after another.
> 
> For example:
> 
>     reader->SetFileName("myImage1.mhd");
>     reader->Update();
> 
>     reader->SetFileName("myImage2.mhd");
>     reader->Update();
> 
> 
> The simple solution is to call "UpdateLargestPossibleRegion()"
> instead of calling the typical "Update()" method.
> 
> So your code your look more like:
> 
> 
>     reader->SetFileName("myImage1.mhd");
>     reader->UpdateLargestPossibleRegion();
> 
>     reader->SetFileName("myImage2.mhd");
>     reader->UpdateLargestPossibleRegion();
> 
> 
> Please let us know if that helps,
> 
> 
>      Thanks
> 
> 
>           Luis
> 
> 
> --------------------------------------------------------------------------------------------------------
> On Mon, Dec 7, 2009 at 5:11 PM, Gupt <adityargupta at gmail.com> wrote:
>>
>> Hello,
>>
>> I'm working with ImageSeriesReadWrite.cxx example from ITK user guide.
>> I'm
>> trying to build the 3d volume from a set of 2d mri images -
>> file280054.jpg
>> to file280062.jpg. But I'm receiving the following error:
>>
>> ExceptionObject Caught!
>>
>> itk:ExceptionObject <0134F560>
>> itk::Location: "void __thiscall itk::ImageFileWriter<class
>> itk::Image<unsigned
>> char,3> >::Write(void)"
>> File: c:\itk\insight_toolkit\code\io\itkImageFileWriter.txx
>> Line: 271
>> Description: itk::ERROR: ImageFileWriter(01934508): Largest possible
>> region
>> does not fully contain requested paste IO regionPaste IO region:
>> ImageIORegion (0134F998)
>>  Dimension: 3
>>  Index: 0 0 0
>>  Size: 0 0 0
>> Largest possible region: ImageRegion (0134FA4C)
>>  Dimension: 3
>>  Index: [0, 0, 0]
>>  Size: [0, 0, 0]
>>
>> Thanks for your help.
>>
>> Gupt
>>
>>
>>
>>
>> Luis Ibanez wrote:
>>>
>>> Hi Gupt,
>>>
>>> We no longer make any difference between a sequence of 2D slices
>>> and a 3D volume... unless.... they are not aligned, or... the spacing in
>>> the inter-slice direction is more than 5 times the intra-slice spacing.
>>>
>>>
>>> If you have segmentations for all the 2D slices, you can simply load
>>> them
>>> all into a single 3D image using an ImageSeriesReader, and then you
>>> can process it as a 3D volume.  More specifically, you can proceed to
>>> compute its volume by using the LabelStatisticsImageFilter.
>>>
>>>
>>>      Regards,
>>>
>>>
>>>            Luis
>>>
>>>
>>> --------------------------------
>>> On Mon, Dec 7, 2009 at 12:10 PM, Aditya Gupta <adityargupta at gmail.com>
>>> wrote:
>>>> Hello Luis,
>>>>
>>>> Thanks for the reply. In continuation to my previous question... So
>>>> using
>>>> the stack of 2d MRI slices, I've a certain segmentation on each of the
>>>> slices and using the segmented output I've built a surface model and
>>>> now
>>>> I've incorporated the intensities of the slices in the surface model.
>>>> Now,
>>>> I'm interested to find the volume of the segmented region. So, using
>>>> the
>>>> segmented outputs from the various slices, I want to reconstruct a
>>>> volume,
>>>> compute and finally visualize the volume. Can you give me a start on
>>>> how
>>>> I
>>>> can proceed? Is it possible to build a 3d volume (not surface model)
>>>> from
>>>> a
>>>> stack of 2d slices (only one axial view not 3 views)? Are there any
>>>> standard
>>>> algorithms being used for construction of 3d volumes from 2d slices?
>>>>
>>>> Appreciate your help in this matter.
>>>>
>>>> Regards,
>>>> Gupt
>>>>
>>>> On Wed, Dec 2, 2009 at 7:07 PM, Luis Ibanez <luis.ibanez at kitware.com>
>>>> wrote:
>>>>>
>>>>> Hi  Gupt,
>>>>>
>>>>>
>>>>> Yes, just do the following:
>>>>>
>>>>>
>>>>> A) Load the 2D slices into a single 3D image using the
>>>>>     itk::ImageSeriesReader,
>>>>>
>>>>>
>>>>> B) Connect the image an ImageInterpolator
>>>>>     The typical choice is the itkLinearImageInterpolateFunction class,
>>>>>     (but you can also use NearestNeighbors, BSpline and
>>>>>      WindowedSinc, it is a trade-off between computation time and
>>>>>      interpolation precision)
>>>>>
>>>>>
>>>>> C) Take all the points from your surface model and for every
>>>>>     point call the method:
>>>>>
>>>>>       PixelType  pixelValue =    Interpolator->Evaluate( point )
>>>>>
>>>>>    and then assign that pixel value to the corresponding point
>>>>>    in the surface model.
>>>>>
>>>>>
>>>>>
>>>>>  Please let us know if you run into any problem.
>>>>>
>>>>>
>>>>>       Thanks
>>>>>
>>>>>
>>>>>          Luis
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------
>>>>> On Wed, Dec 2, 2009 at 2:35 PM, Gupt <adityargupta at gmail.com> wrote:
>>>>> >
>>>>> > I've a stack of 2d cardiac mri images in single view. I've written
>>>>> the
>>>>> > code
>>>>> > to do a surface reconstruction of the left ventricle wall of the
>>>>> heart
>>>>> > (looks like a hollow cylinder). Is there a method/ function to
>>>>> > incorporate
>>>>> > the intensity information (in the 2d slices) in to the model, like
>>>>> some
>>>>> > kind
>>>>> > of interpolation to obtain intensity between the slices? Thanks for
>>>>> the
>>>>> > help.
>>>>> > --
>>>>> > View this message in context:
>>>>> > http://old.nabble.com/Interpolation-Volume-tp26614974p26614974.html
>>>>> > Sent from the ITK - Users mailing list archive at Nabble.com.
>>>>> >
>>>>> > _____________________________________
>>>>> > 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.html
>>>>> >
>>>>> > 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
>>>>> >
>>>>
>>>>
>>>>
>>>> --
>>>> Regards,
>>>> Aditya Gupta, Ph.D.
>>>> Post Doc Researcher
>>>> UCF Computer Vision Lab
>>>> Orlando, FL
>>>> O: (407) 882 0130
>>>> M: (407) 451 7735
>>>>
>>> _____________________________________
>>> 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.html
>>>
>>> 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
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Interpolation-Volume-tp26614974p26685129.html
>> Sent from the ITK - Users mailing list archive at Nabble.com.
>>
>> _____________________________________
>> 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.html
>>
>> 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.html
> 
> 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
> 
> 

-- 
View this message in context: http://old.nabble.com/Interpolation-Volume-tp26614974p26700914.html
Sent from the ITK - Users mailing list archive at Nabble.com.



More information about the Insight-users mailing list