[ITK-users] How to write the codes in python?

Matt McCormick matt.mccormick at kitware.com
Tue Nov 3 23:52:58 EST 2015


Hello Zhuangming,

Here is a gist:

  https://gist.github.com/thewtex/ce403fef7bc09ca5392d

Note that you should ensure that ITK_WRAP_unsigned_short is ON in your
CMake configuration.

HTH,
Matt

On Tue, Nov 3, 2015 at 7:17 PM, 沈庄明 <zhuangming.shen at sphic.org.cn> wrote:
> Hi all,
>
>
> I'd like to know how to convert Image1.cxx (see codes below) to python,
> especially "ImageType::RegionType region;". Could anyone give me some hints?
> Thanks in advance.
>
>
>
> typedef itk::Image<unsigned short, 3> ImageType;
>
> ImageType::Pointer image = ImageType::New();
>
>
> ImageType::IndexType start;
>
> start[0] = 0;
>
> start[1] = 0;
>
> start[2] = 0;
>
>
> ImageType::SizeType size;
>
> size[0] = 200;
>
> size[1] = 200;
>
> size[2] = 200;
>
>
> ImageType::RegionType region;
>
> region.SetSize(size);
>
> region.SetIndex(start);
>
>
> image->SetRegions(region);
>
> image->Allocate();
>
>
>
> Regards,
>
>
> Zhuangming Shen
>
>
> _____________________________________
> 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 Insight-users mailing list