Program: gdcm
Module: $RCSfile: vtkgdcmViewer.cxx,v $
Language: C++
- Date: $Date: 2007/08/28 09:41:39 $
- Version: $Revision: 1.30 $
+ Date: $Date: 2009/11/03 14:05:23 $
+ Version: $Revision: 1.32 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
if ( event == vtkCommand::CharEvent )
{
-#if (VTK_MAJOR_VERSION >= 5)
- int max = ImageViewer->GetSliceMax();
- int slice = (ImageViewer->GetSlice() + 1 ) % ++max;
- ImageViewer->SetSlice( slice );
-#else
int max = ImageViewer->GetWholeZMax();
int slice = (ImageViewer->GetZSlice() + 1 ) % ++max;
ImageViewer->SetZSlice( slice );
-#endif
-#if !( (VTK_MAJOR_VERSION >= 5) || ( VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION >= 5 ) )
- // This used to be a bug in version VTK 4.4 and earlier
- ImageViewer->GetRenderer()->ResetCameraClippingRange();
-#endif
ImageViewer->Render();
}
}
reader->SetLoadMode(GDCM_NAME_SPACE::LD_NOSHADOWSEQ);
reader->Update();
+
+
+std::cout << "[0][0]==========" <<
+reader->GetOutput()->GetScalarComponentAsFloat(0,0,0,0) <<
+"===================="
+<< std::endl;
+std::cout << "[127][127]==========" <<
+reader->GetOutput()->GetScalarComponentAsFloat(0,127,0,0) <<
+"===================="
+<< std::endl;
+
+
//print debug info:
reader->GetOutput()->Print( cout );
iren->Initialize();
iren->Start();
- //if you wish you can export dicom to a vtk file
+ //if you wish you can export dicom to a vtk file
+
vtkStructuredPointsWriter *writer = vtkStructuredPointsWriter::New();
writer->SetInput( reader->GetOutput());
writer->SetFileName( "foo.vtk" );
writer->SetFileTypeToBinary();
//writer->Write();
+
+std::cout << "==========" << std::endl;
+
+std::cout << "==========" <<
+reader->GetOutput()->GetScalarComponentAsFloat(0,0,0,0) <<
+"===================="
+<< std::endl;
+
+
reader->Delete();
iren->Delete();