[Insight-users] pointer to image data

Angobar agb1 at alu.upct.es
Fri Jul 29 05:53:16 EDT 2011


 

 

Thanks for your reply J

 

What I want to do is to translate an image that is referenced with a doublé* pointer to a itk smartpointer. I think that the filter structure is not suitable for me in that case.

 

I have try this : ImageType::Pointer salida = ImageType::New();

                salida = reinterpret_cast<ImageType::Pointer> (out_inv);

 

But is not working, then I have try with a function that do this process:

 

 

void prueba_r01::double2itk( double* im_proc, ImageType::Pointer salida, int alto, int ancho)

{

                ImageType::IndexType pixelIndex;

                ImageType::PixelType pixelValue;

 

                for (int x=0; x<ancho; x++){

                               pixelIndex[0]=x;

                               for (int y=0; y<alto; y++){

                                               pixelIndex[1]=y;

                                               pixelValue= *(im_proc+x+ancho*y);

                                               salida->SetPixel(pixelIndex,pixelValue);

                               }

 

                }

}

 

But is giving me some problems in run-time….

 

Thanks for your help!!

Regards

 

 

Antonio

 

De: barbababa [via ITK Insight Users] [mailto:ml-node+6631419-747877077-344494 at n2.nabble.com] 
Enviado el: jueves, 28 de julio de 2011 23:27
Para: Angobar
Asunto: Re: pointer to image data

 

Hello!

Sorry for the late reply but i am on holidays now so i check my emails not so often.
and i also do not have any examples here to show since i am in a another country.
but basically you can make this up for any filter. for example a very easy one
to compile is the recursivegaussian filter.
also i am just implementing itk functions to another application and i don't
think you will gain any insight about that applications preferences of how to 
make pointers to data. but what i have to do is:

1. create an image with correct size an pixel type
2. lock that data as continuous block
3. make a pointer with reinterpret_cast to that image's data
4. and then use the output of an itk filter as i wrote in that email.

Hope this helps!

Cheers,
toni





2011/7/27 Angobar [via ITK Insight Users] <[hidden email]>

Sorry, I have a very similar problem just right now, what kind of object o what was the definition of "filter" for this case? 

Regards 

Antonio Gómez Barquero 
Universidad Politécnica de Cartagena 

  _____  

If you reply to this email, your message will be added to the discussion below:

http://itk-insight-users.2283740.n2.nabble.com/pointer-to-image-data-tp6596336p6625731.html 

To unsubscribe from pointer to image data, click here. 





  _____  

If you reply to this email, your message will be added to the discussion below:

http://itk-insight-users.2283740.n2.nabble.com/pointer-to-image-data-tp6596336p6631419.html 

To unsubscribe from pointer to image data, click here <http://itk-insight-users.2283740.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=6596336&code=YWdiMUBhbHUudXBjdC5lc3w2NTk2MzM2fC0xNzM3MTAzNzE3> . 



--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/pointer-to-image-data-tp6596336p6632931.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.


More information about the Insight-users mailing list