[Insight-users] Compiling WrapITK on Windows XP

Sven Prevrhal sven.prevrhal at radiology.ucsf.edu
Thu Jun 21 22:56:40 EDT 2007


(And RE: [Insight-users] Passing ITK objects from Python to C code of a
Python extension)

Thanks Gaëtan,

So I tried building with MSVC 2003.NET and failed because the compiler has a
65,536 line limitation. Then I build with MSVC 2005 C++ Express and no
compiler errors were issued. However, the INSTALL target complained:

52>C:/packages/Insight-CVS-VC2005/Wrapping/WrapITK/Modules/Base/cmake_instal
l.cmake:141:
52>FILE INSTALL cannot find file
"C:/packages/Insight-CVS-VC2005/bin/Release/SwigExtras.py" to install.

I did find a SwigExtras.i, .h and .cmake in the sources but that apparently
did not get compiled into a swigextras.py. When I rebuilt the _BasePython
target and (automatically selected) the dependent targets, that procuded
swigextras.py in the bin/Release/ directory
The INSTALL target (after a recompile of a bunch of apparently altered
projects, including the examples was automatically triggered) then also
installed. I can do
>>>import itk
now, great!

So what triggers the MSV IDE to reload some of the projects after the
initial build and causes them to be built again for the INSTALL target?
 
Thanks,
Sven

-----Original Message-----
From: Gaëtan Lehmann [mailto:gaetan.lehmann at jouy.inra.fr] 
Sent: Wednesday, June 20, 2007 1:10 PM
To: Sven Prevrhal
Cc: Insight Users
Subject: Re: [Insight-users] Passing ITK objects from Python to C code of a
Python extension


Le 20 juin 07 à 21:57, Sven Prevrhal a écrit :

> Thanks Gaëtan,
> Will WrapITK work on Win XP? I saw some warnings.

it works for sure with visual studio express 2005

> Also, where do I find the
> insight journal archives?
>

http://insight-journal.org/

>
> Thanks,
> Sven
>
> -----Original Message-----
> From: Gaëtan Lehmann [mailto:gaetan.lehmann at jouy.inra.fr]
> Sent: Wednesday, June 20, 2007 12:23 PM
> To: Sven Prevrhal
> Cc: insight-users at itk.org
> Subject: Re: [Insight-users] Passing ITK objects from Python to C  
> code of a
> Python extension
>
>
> Hi Sven,
>
> You should use WrapITK to do that. Extending WrapITK is very easy in
> python, and you can find several examples in the ExternalProjects
> directory, and in my contributions to the insight journal.
>
> Regards,
>
> Gaëtan
>
>
> Le 20 juin 07 à 04:32, Sven Prevrhal a écrit :
>
>> Since there are apparently some issues with converting strings and
>> vectors
>> of strings to/from Python and ITK and I have not figured out how
>> to, from
>> Python,
>> 	- use DICOMSeriesFileNames to get a set of file names pertaining to
>> one SeriesUID
>> 	- read it with ImageSeriesReader
>> 	- Use ConnectITKToVTK to transfer the images over to VTK for
>> visualization
>>
>> I thought I would write a Python extension that would accept a
>> SeriesUID,
>> execute those steps and return a vtkImageData object to Python for
>> further
>> processing. But I fail to figure out how to pass an ITK object to my
>> Python/C code.
>>
>> I was thinking something like this for Python extension .cxx file -
>>
>> static PyObject *
>> PyITKHelloWorld_ITKHelloWorld(PyObject *self, PyObject *args)
>> {
>> 	ImageType::Pointer argImage;
>> 	PyObject * arg1;
>>
>>     if (!PyArg_ParseTuple(args, "O", &arg1))
>>         return NULL;
>> 	
>> 	// THIS LINE DOES NOT COMPILE
>> 	argImage= (itk::Image< unsigned short, 3 >::Pointer) arg1;
>> ...
>>
>>
>> and in Python,
>>
>> im = itkImageUS3_New()
>> PyITKHelloWorld.ITKHelloWorld(im.GetPointer())
>>
>> ...
>>
>>
>> Needless to say, the code does not compile (can import my extension
>> though,
>> and I have a very simple method without passing an ITK object that
>> works
>> just fine, so the basics are OK). Am I completely off? Or what do I
>> need to
>> do?
>>
>> Thanks!
>>
>> Sven
>>
>>
>>
>>
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
>
> --
> Gaëtan Lehmann
> Biologie du Développement et de la Reproduction
> INRA de Jouy-en-Josas (France)
> tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
> http://voxel.jouy.inra.fr
>
>
>
>
>

--
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr







More information about the Insight-users mailing list