[ITK] [ITK-users] Using Requested Regions with Filter

CHENET Aude (External) Aude.CHENET-ext at galderma.com
Tue May 10 10:19:55 EDT 2016


Hello,

I'm using ITK (with Python wrapping) and I'd like to work only on a part of an image (because of memory problems)
I've declared the requestedRegion for the output of my filter, but still have the memory problem.
Do I have to declare something else to the filter?

Here is my code :
    pixelType = itk.SS
    imageType = itk.Image[pixelType,3]
    readerType = itk.ImageFileReader[imageType]
    reader = readerType.New()
    reader.SetFileName('resamp.tif')

    imageResamp = reader.GetOutput()

    idx = itk.Index[3]()
    idx[1]=80
    s = itk.Size[3]()
    s[0]=1354
    s[1]=20
    s[2]=1440
    region = itk.ImageRegion[3]()
    region.SetIndex(idx)
    region.SetSize(s)

    imageResamp.SetBufferedRegion(region)
    imageResamp.SetRequestedRegion(region)

    h = itk.HessianRecursiveGaussianImageFilter[imageType].New()
    h2v = itk.Hessian3DToVesselnessMeasureImageFilter[itk.SS].New()
    h2v.SetInput(h.GetOutput())

    h.SetInput(imageResamp)
    h2v.GetOutput().SetRequestedRegion(region)
    h2v.GetOutput().UpdateOutputInformation()
    h2v.GetOutput().PropagateRequestedRegion()

    h2v.Update()


Thanks for your help.

Aude
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160510/f3c2b2a9/attachment.html>
-------------- next part --------------
_____________________________________
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://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list