[Insight-users] error while extracting slice in x and y direction <solved>

Jayachandran, Ganesh ganesh.jayachandran at philips.com
Sat Mar 17 20:22:57 EDT 2012


Hi,

After some search through the older blogs, I was able to fix the issue by using UpdateLargestPossibleRegion() instead of update in the extract image filter and the other filters following extract image filter.

Regards,
Ganesh
________________________________
From: Jayachandran, Ganesh
Sent: Sunday, March 18, 2012 12:17 AM
To: insight-users at itk.org
Subject: error while extracting slice in x and y direction



Hi,

I am trying to extract a slice in the x and y direction other than the z direction. Initially the direction is set to "z" and then the direction is set to "x". The code works fine for "z" direction but when I set the direction to "x", I get an error
as below

Requested region is (at least partially outside the largest possible region.

Kindly let me know what I have done wrong. Pl. find the code snippet below. The code is called iteratively for the same MR data.

    size = inputRegion.GetSize();
    start = inputRegion.GetIndex();

    size[direction] = 0;
    start[direction] = number;


    //Now set the parametrs to the extract the desired region
    //the parameters are size and slice number
    InputImageType::RegionType desiredRegion;
    desiredRegion.SetSize( size );
    desiredRegion.SetIndex( start );

    filter->SetExtractionRegion( desiredRegion );
    filter->SetInput( output );
    filter->Update();

________________________________
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120318/4dbda928/attachment.htm>


More information about the Insight-users mailing list