[vtkusers] Re: Modify scalar values

Moti Freiman freiman at cs.huji.ac.il
Thu Jan 20 12:14:39 EST 2005


Hello!
As far as I know, you can't just copy vtk pointers. instead of it you 
should use:

<>vtkDataArray *scalarArrayDestination = vtkDataArray::New()
and on of the beloew:
scalarArrayDestination ->DeepCopy 
(LabeledImage->GetPointData()->GetScalars());
scalarArrayDestination->ShallowCopy 
(LabeledImage->GetPointData()->GetScalars());
the difference between ShallowCopy, and DeepCopy, is that shallow copy 
just create another reference to the same object.
and deepcopy, make another new object.
for more details you can take a look at the vtk documentation.
be aware that vtkDataArray is abstract class, you should use 
vtkFloatArray, or something like this.
hope it helps.

-- 
Moti Freiman, Graduate Student.
Medical Image Processing and Computer-Assisted Surgery Laboratory.
School of Computer Science and Engineering.
The Hebrew University of Jerusalem Givat Ram, Jerusalem 91904, Israel 
Phone: +(972)-2-658-5371 (laboratory) 
E-mail: freiman at cs.huji.ac.il
WWW site: http://www.cs.huji.ac.il/~freiman  



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.0 - Release Date: 17/01/2005



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.0 - Release Date: 17/01/2005




More information about the vtkusers mailing list