[Fwd: Re: [vtkusers] get the point intensity?]
Laurent Mundeleer
lmundele at ulb.ac.be
Wed Feb 4 10:37:12 EST 2004
-------- Original Message --------
Subject: Re: [vtkusers] get the point intensity?
Date: Wed, 04 Feb 2004 16:36:50 +0100
From: Laurent Mundeleer <lmundele at ulb.ac.be>
To: Mathieu Malaterre <mathieu.malaterre at kitware.com>
References: <400F95C2.6030601 at ulb.ac.be>
<003301c3e166$a4b11b90$b201a8c0 at win.lucidindia.net>
<4010C971.80008 at ulb.ac.be>
<006a01c3e234$443533e0$b201a8c0 at win.lucidindia.net>
<4020CFC5.7040507 at ulb.ac.be> <402106C9.7030503 at kitware.com>
Hi Mathieu,
in fact I have a volume image, so a z direction too.
But I've found my two mistakes :
- using the input of the mapper who as you said as only 2D, instead of
the slicer's one
- not using physical image size, but displayed size...
I was looking too far for my mistakes, as usual ;-)
thanks anyway
Laurent
Mathieu Malaterre wrote:
> Laurent,
>
> Your current extent is:
>
> Current extent= (0, 668, 0, 658, 0, 0)
> This is 2D image no z dimension.
>
> But you are trying to access another slice just as a volume. Don't try
> accessing anything along the z direction, z should = 0.
>
> Mathieu
>
> Laurent Mundeleer wrote:
>
>> Hi,
>>
>> I use VC++, and I still have a problem with the functions obtaining
>> scalars values in images.
>> I'd like to calculate it in one time with GetScalars, but I've an error
>> saying this :
>> "
>> ERROR: In C:\vtk\vtksrc\Common\vtkImageData.cxx, line 1571
>> vtkImageData (0x05571A40): GetScalarPointer: Pixel (362, 371, 1) not in
>> memory.
>> Current extent= (0, 668, 0, 658, 0, 0)
>>
>> ERROR: In C:\vtk\vtksrc\Common\vtkImageData.cxx, line 1571
>> vtkImageData (0x05571A40): GetScalarPointer: Pixel (362, 371, 2) not in
>> memory.
>> Current extent= (0, 668, 0, 658, 0, 0)
>> ....
>> "
>> Here's the code :
>> when charging the image volume :
>> ...
>> valeursImage = (vtkFloatArray*)
>> mapper->GetScalars(src->GetOutput(),0,0,0,0,*component);
>> ...
>>
>> /************************ test fonction with positions[0] : x ,
>> positions[1] : y
>> void affichageBase::testValues()
>> {
>> if (mapper->GetInput()->GetScalarPointer() != NULL)
>> {
>> float res;
>> for (int i = 0; i< 20 ; i++)
>> {
>> res =
>> mapper->GetInput()->GetScalarComponentAsFloat(positions[0],
>> positions[1], i, 0);
>> cout<<"val res : "<<res<<" en " <<positions[0]<<" , "
>> <<positions[1]<<" , " <<i<<endl;
>> cout<<"val component :
>> "<<valeursImage->GetComponent(mapper->GetInput()->FindPoint(positions[0],
>>
>> positions[1], i) ,0)<<" en " <<positions[0]<<" , " <<positions[1]<<" , "
>> <<i<<endl;
>> }
>>
>> }
>> }
>> ******************************/
>> The output of this code is :
>> "
>> val res : 255 en 367 , 344 , 0
>> val component : 24 en 367 , 344 , 0
>> val res : 0 en 367 , 344 , 1
>> val component : 3.94606e-042 en 367 , 344 , 1
>> val res : 0 en 367 , 344 , 2
>> val component : 3.94606e-042 en 367 , 344 , 2
>> val res : 0 en 367 , 344 , 3
>> ...
>> "
>> So, first, the values for the point of the image ont the screen are
>> different with the two methodes. Are the IDs unique?
>> Secondly, I've NULL values for the images who aren't rendered.
>>
>> What should I do?
>>
>> thanks
>>
>> Laurent
>>
>> PS : sorry for the preview message with truncated title
>>
>
>
>
>
--
********************************************
Laurent Mundeleer
Université Libre de Bruxelles (ULB)
Service des Systèmes Logiques et Numériques (SLN) CP165/57
50, Av. F.Roosevelt
1050 Bruxelles
Belgium
tel : ++32.2.650.22.97
fax : ++32.2.650.22.98
e-mail : lmundele at ulb.ac.be
********************************************
--
********************************************
Laurent Mundeleer
Université Libre de Bruxelles (ULB)
Service des Systèmes Logiques et Numériques (SLN) CP165/57
50, Av. F.Roosevelt
1050 Bruxelles
Belgium
tel : ++32.2.650.22.97
fax : ++32.2.650.22.98
e-mail : lmundele at ulb.ac.be
********************************************
More information about the vtkusers
mailing list