[vtkusers] A question about vtkImageCanvasSource2D

Belaroussi, Boubakeur Boubakeur.Belaroussi at bioclinica.com
Tue Apr 3 07:24:08 EDT 2012


Hi all,

 

I am currently using vtkImageCanvasSource2D (VTK 5.8.0 - Visual Studio
10 - Windows). However, I've noticed that the "DrawImage" method of this
class does not take into account the DefaultZ (see code below from
vtkImageCanvasSource2D.cxx):

//  int z = this->DefaultZ;

.....

//  if (this->Ratio[2] != 1.0)

//    {

//    z = int(double(z) * this->Ratio[2]);

//    }

....

//z = (z < extent[4]) ? extent[4] : z;

//z = (z > extent[5]) ? extent[5] : z;

....

//z = (z < extent[4]) ? extent[4] : z;

//z = (z > extent[5]) ? extent[5] : z;

....

void *ptr;

void *sptr;

ptr = this->ImageData->GetScalarPointer(min0, min1, 0);

sptr = ic->GetOutput()->GetScalarPointer(ext[0], ext[2], 0);

....

 

It seems that using this method only draws an image at z=0 in the
canvas.

Moreover, for all other methods (FillBox, DrawPixel, DrawCircle ...),
the DefaultZ is taken into account and the pointers are correctly
initialized:

int z = this->DefaultZ;

void *ptr;

ptr = this->ImageData->GetScalarPointer(min0, min1, z);

 

I may have missed something.

Any help or alternative will be appreciated.

 

Thank you.

Regards,

Bouba
 
--
Confidentiality Notice: This e-mail transmission may contain confidential or legally privileged information that is intended only for the individual or entity named in the e-mail address. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or reliance upon the contents of this e-mail is strictly prohibited. If you have received this e-mail transmission in error, please reply to the sender and then delete the message from your computer. Thank you.
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120403/09fced9a/attachment.htm>


More information about the vtkusers mailing list