[Insight-users] Re: multimiresregistration thanks, vtk!

Christos Panagiotou C.Panagiotou at cs.ucl.ac.uk
Mon, 23 Feb 2004 07:02:41 +0000


luis

sorry that was on me - i forgot to include the vtkImageData.h

now it does not need casting however, problem is still there... no data 
to generate normals





Luis Ibanez wrote:
Hi Christos,

Is there any particular reason why you are forcing the
casting the output of the vtkMetaImageReader ?

> vtkContourFilter *skinExtractor = vtkContourFilter::New();
>    skinExtractor->SetInput((vtkDataSet *)meta->GetOutput());



You shouldn't need to cast this output.


Please let us know,


Thanks,



Luis Ibanez wrote:

>
> Hi Christos,
>
> Is there any particular reason why you are forcing the
> casting the output of the vtkMetaImageReader ?
>
>> vtkContourFilter *skinExtractor = vtkContourFilter::New();
>>    skinExtractor->SetInput((vtkDataSet *)meta->GetOutput());
>
>
>
> You shouldn't need to cast this output.
>
>
> Please let us know,
>
>
> Thanks,
>
>
>      Luis
>
>
> ----------------------------
>
> Christos Panagiotou wrote:
>
>> Luis
>>
>> thanks for your fast reply
>>
>>
>>
>> paraview reads the .mha file of an example volume from brainweb and
>> makes a nice visualization - ok till here!
>>
>> however i would like to be able to visualize through vtk bymyself...
>>
>> i rewrote the example of the metaImageReader in c++ 
>> (http://public.kitware.com/cgi-bin/cvsweb.cgi/~checkout~/VTK/IO/Testing/Tcl/TestMHD.tcl) 
>>
>> and i use the same .mha which i used for paraview
>>
>> but again i had the sameerror, stating that there is no data to 
>> generate the normals!
>> i dont know what am i doing wrong! :(
>>
>>
>> thats the important parts of my code - i just tried to keep the 
>> options as simple as possible
>>
>> (I havent used a vtkLookupTable)
>>
>>  const char *metafname = 
>> "/home/christos/PhD/Data/raw/Brain1Rot/Brain/brainweb1e1a10f20Rot10Tx15.mha"; 
>>
>>
>>  vtkMetaImageReader *meta = vtkMetaImageReader::New();
>>    meta->SetFileName(metafname);   vtkContourFilter *skinExtractor = 
>> vtkContourFilter::New();
>>    skinExtractor->SetInput((vtkDataSet *)meta->GetOutput());     
>> skinExtractor->SetValue(0, 255);
>>    skinExtractor->ComputeNormalsOff();
>>    skinExtractor->ComputeGradientsOff();      /*
>>  vtkPolyDataNormals *skinNormals = vtkPolyDataNormals::New();
>>  skinNormals->SetInput(skinExtractor->GetOutput());
>>  skinNormals->SetFeatureAngle(60.0);
>>   */
>>  vtkPolyDataMapper *skinMapper = vtkPolyDataMapper::New();
>>    skinMapper->SetInput(skinExtractor->GetOutput());
>>    skinMapper->ScalarVisibilityOn();
>>    skinMapper->SetScalarModeToUsePointFieldData();
>>
>>  and then i render it...
>>
>>
>> i would be greatful for some help!
>> thanks
>> christos
>>  
>>
>>
>>
>>
>
>
>
>
>