<div>Thank you Luis.</div>
<div>The image->GetBufferPointer(); was just what i needed...it seems to be working quite alright now.</div>
<div> </div>
<div>Regards<br><br> </div>
<div><span class="gmail_quote">2006/10/28, Luis Ibanez <<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>>:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Hi Prename Surname,<br><br><br><br> Yes, We have done this before.<br><br><br><br>You should look at the examples of the VolView Plugins.
<br><br><br>They are in the directory:<br><br><br> InsightApplications/VolviewPlugins<br><br><br>The plugins are built in DLLs and VolView invoke them<br>to perform processing in the images.<br><br><br><br>What you must respect is:
<br><br><br> A) Memory allocated in your program<br> *MUST NOT* be released by the DLL.<br><br><br> B) Memory allocated in the DLL<br> *MUST NOT* be released by the program<br><br><br><br>If you are doing the rendering in your DLL, one easy
<br>thing to do is to pass to it the pointer of the pixel<br>data<br><br> image->GetBufferPointer();<br><br><br>and the metadata of<br><br> a) number of pixels<br> b) pixel spacing<br> c) image origin
<br><br>With this information you can in your DLL use the<br>vtkImageImport filter in order to create a vtkImageData<br>that you can pass to your rendering pipeline.<br><br><br><br> Please read the Tutorials.<br><br>
<br><br>The describe things that you have to<br>do in this case anyways.<br><br>In particular, they describe how to prevent<br>the VTK import filter from releasing the memory<br>that you passed to it.<br><br><br><br> Regards,
<br><br><br> Luis<br><br><br><br>------------------------<br>Prename Surname wrote:<br>> But the problem is that my rendering is in a dll.<br>> I mean i can convert an ITK image to a vtk image no problem, but the
<br>> problem is that the vtkimage is to be used in a dll.<br>> So i am trying to do the following<br>><br>> ITK -> convert and transfer to DLL -> VTK<br>><br>> Theoretically it should not pose a problem, but did anyone do this before?
<br>> Regards<br>><br>><br>> 2006/10/28, Luis Ibanez <<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a><br>> <mailto:<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com
</a>>>:<br>><br>><br>> Hi Prename Surname,<br>><br>> Please read the Tutorials:<br>><br>> <a href="http://www.itk.org/HTML/Tutorials.htm">http://www.itk.org/HTML/Tutorials.htm</a>
<br>><br>> In particular:<br>><br>> "Getting Started II: Using ITK with VTK"<br>> <a href="http://www.itk.org/CourseWare/Training/GettingStarted-II.pdf">http://www.itk.org/CourseWare/Training/GettingStarted-II.pdf
</a><br>> <<a href="http://www.itk.org/CourseWare/Training/GettingStarted-II.pdf">http://www.itk.org/CourseWare/Training/GettingStarted-II.pdf</a>><br>><br>> and<br>><br>> "Getting Started V: Integrating ITK in your Application."
<br>> <a href="http://www.itk.org/CourseWare/Training/GettingStarted-V.pdf">http://www.itk.org/CourseWare/Training/GettingStarted-V.pdf</a><br>> <<a href="http://www.itk.org/CourseWare/Training/GettingStarted-V.pdf">
http://www.itk.org/CourseWare/Training/GettingStarted-V.pdf</a>><br>><br>><br>> The first one describes how to convert ITK images into VTK images.<br>><br>> You will find examples in the directory:
<br>><br>> InsightApplications/Auxiliary/vtk/<br>><br>> itkReadITKImage3DSegmentShowVTK.cxx<br>> itkReadITKImageSegmentShowVTK.cxx<br>> itkReadITKImageShowSplineVTK.cxx<br>>
itkReadITKImageShowVTK.cxx<br>><br>><br>> The second one describes multiple options for passing ITK image<br>> data to and from applications that use pointers to the pixel<br>> buffer.<br>><br>
><br>> Please not that you must make sure that the memory is relased<br>> correctly once you are done with the image.<br>><br>><br>> Regards,<br>><br>><br>> Luis<br>><br>
><br>> ----------------------------<br>> Prename Surname wrote:<br>> > Hello. I have an itk::Image objekt where i want to be able to get a<br>> > pointer to the data, so that i can send this pointer as a
<br>> parameter to<br>> > my dll function, which<br>> > implements rendering using VTK.<br>> ><br>> > The only problem is how i can transport the data, and it seems that a
<br>> > raw datapointer is the best solution.<br>> ><br>> > How can i retrieve that?<br>> > Many regards<br>> ><br>> ><br>> ><br>> ------------------------------------------------------------------------
<br>><br>> ><br>> > _______________________________________________<br>> > Insight-users mailing list<br>> > <a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a> <mailto:
<a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a>><br>> > <a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br>><br>><br></blockquote>
</div><br>