[vtkusers] to pipeline or not to pipeline, that is the question

Nico Vermaas vermaas at astron.nl
Fri Jun 13 07:07:15 EDT 2003


Jeff,

Yes I did, I overloaded the Update() function though, it calls my reader->Execute() function which does the low level reading and fills the vtkImageData of the GetOutput(). And obviously it gets filled somehow because the deepcopy does give me the data.

So this is correct syntax then?:
"dataFits=this->fitsReader->GetOutput();"

Nico

====================================================
Nico Vermaas
ASTRON - Westerbork Synthesis Radio Telescope
Schattenberg 1 - 9433 TA Zwiggelte - The Netherlands

tel: +31 593 598710                 
vermaas at astron.nl 
====================================================
>>> Jeff Lee <jeff at cdnorthamerica.com> 06/13/03 12:08 PM >>>
did you try reader->Update() ?
-Jeff

Nico Vermaas wrote:

>Hi,
>
>There may be a bug in my understanding of VTK, can somebody enlighten me?
>
>I have build a reader (fitsReader) that gives back a vtkImageData.
>
>It works fine when I define a new vtkImageData (as a member) and (deep)copy the scalars from the reader's result to this new vtkImageData. Like this:
>
>vtkImageData *dataFits = vtkImageData::New();
>dataFits=this->fitsReader->GetOutput();
>this->myImageData->GetPointData()->DeepCopy(dataFits->GetPointData());
>dataFits->Delete();
>mapper->SetInput(this->myImageData);
>etc...
>
>It also works when I insert a vtkExtractVOI in the pipeline before the Mapper.
>
>But... when I just connect my reader's output to that same new vtkImageData then I do not get any data, like this: 
> 
>myImageData=fitsReader->GetOutput(); 
>
>Also....
>When I do use the 'deepcopy' solution (I get data in myImageData then) and when I then insert a vtkShiftScale into the pipeline (to go from floats to unsigned chars) I lose my data again. Like this:
>
>myImageData->Update(); 
>myShiftedScaledData->SetInput(myImageData);
>myShiftedScaledData->SetShift(-range[0]);
>myShiftedScaledData->SetScale(255./(range[1]-range[0]));
>myShiftedScaledData->SetOutputScalarTypeToUnsignedChar();
>
>And this gives an error then ('pixel not in memory'):
>value=(float*) myShiftedScaledData->GetOutput()->GetScalarPointer(x,y,z);
>
>Ergo:
>I have the feeling that I forget something crucial.
>q: is that deepcopy necisary or a dumb solution?
>q: should that 'myImageData=fitsReader->GetOutput()' work? (should myImageData contain the scalar data?)
>q: does anybody see anything wrong?
>
>Some insight would be much appreciated, Thanks,
>
>Nico 
> 
>
>
>
>====================================================
>Nico Vermaas
>ASTRON - Westerbork Synthesis Radio Telescope
>Schattenberg 1 - 9433 TA Zwiggelte - The Netherlands
>
>tel: +31 593 598710                 
>vermaas at astron.nl 
>====================================================
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers
>
>
>  
>





More information about the vtkusers mailing list