#include "vtkImageData.h"
#include "vtkPointData.h"
#include "vtkPolyData.h"
#include "vtkProperty.h"
#include "vtkPolyDataMapper.h"
#include "vtkActor.h"
#include "vtkRenderer.h"
#include "vtkCellArray.h"
#include "vtkPoints.h"
#include "vtkDoubleArray.h"
#include <vtkXMLImageDataWriter.h>
#include <vtkRenderWindowInteractor.h>
#include "vtkVersion.h"
int main(int argc, char *argv[])
{
if( argc < 3 )
{
std::cerr << argv[0] << " filename.dcm outfile.vti\n";
return 1;
}
const char * filename = argv[1];
const char * outfilename = argv[2];
{
return 1;
}
{
return 1;
}
{
return 1;
}
if( !sqi || !sqi->GetNumberOfItems() )
{
return 1;
}
{
return 1;
}
gdcm::Tag tcompensatorthicknessdata(0x300a,0x00ec);
{
return 1;
}
std::cout << at1.
GetValue() << std::endl;
std::cout << at2.
GetValue() << std::endl;
std::cout << at3.
GetValue(0) << std::endl;
std::cout << at4.
GetValue(0) << std::endl;
vtkDoubleArray *d = vtkDoubleArray::New();
vtkImageData *img = vtkImageData::New();
img->Initialize();
#if (VTK_MAJOR_VERSION >= 6)
assert(0);
#else
img->SetScalarTypeToDouble();
#endif
#if (VTK_MAJOR_VERSION >= 6)
assert(0);
#else
img->SetNumberOfScalarComponents(1);
#endif
img->GetPointData()->SetScalars(d);
vtkXMLImageDataWriter *writeb= vtkXMLImageDataWriter::New();
#if (VTK_MAJOR_VERSION >= 6)
writeb->SetInputData( img );
#else
writeb->SetInput( img );
#endif
writeb->SetFileName( outfilename );
writeb->Write( );
{
return 1;
}
{
return 1;
}
vtkDoubleArray *scalars = vtkDoubleArray::New();
scalars->SetNumberOfComponents(3);
{
return 1;
}
std::cout << bnpts.
GetValue() << std::endl;
vtkPolyData *output = vtkPolyData::New();
vtkPoints *newPts = vtkPoints::New();
vtkCellArray *polys = vtkCellArray::New();
vtkIdType *ptIds = new vtkIdType[npts];
for(unsigned int i = 0; i < npts; ++i)
{
float x[3] = {};
x[0] = (float)ptr[2*i+0];
x[1] = (float)ptr[2*i+1];
vtkIdType ptId = newPts->InsertNextPoint( x );
ptIds[i ] = ptId;
}
vtkIdType cellId = polys->InsertNextCell(npts , ptIds);
(void)cellId;
delete[] ptIds;
output->SetPoints(newPts);
newPts->Delete();
output->SetPolys(polys);
polys->Delete();
#if (VTK_MAJOR_VERSION >= 6)
#else
output->Update();
#endif
output->Print( std::cout );
vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
#if (VTK_MAJOR_VERSION >= 6)
viewer->SetInputData(img);
#else
#endif
vtkPolyDataMapper *cubeMapper = vtkPolyDataMapper::New();
#if (VTK_MAJOR_VERSION >= 6)
cubeMapper->SetInputData( output );
#else
cubeMapper->SetInput( output );
#endif
cubeMapper->SetScalarRange(0,7);
vtkActor *cubeActor = vtkActor::New();
cubeActor->SetMapper(cubeMapper);
vtkProperty * property = cubeActor->GetProperty();
property->SetRepresentationToWireframe();
viewer->GetRenderer()->AddActor( cubeActor );
iren->Initialize();
iren->Start();
return 0;
}
Attribute class This class use template metaprograming tricks to let the user know when the template ...
Definition gdcmAttribute.h:86
const ArrayType * GetValues() const
Definition gdcmAttribute.h:178
ArrayType & GetValue(unsigned int idx=0)
Definition gdcmAttribute.h:154
static Tag GetTag()
Definition gdcmAttribute.h:98
void SetFromDataElement(DataElement const &de)
Definition gdcmAttribute.h:206
Class to represent a Data Element either Implicit or Explicit.
Definition gdcmDataElement.h:59
SmartPointer< SequenceOfItems > GetValueAsSQ() const
Class to represent a Data Set (which contains Data Elements)
Definition gdcmDataSet.h:56
const DataElement & GetDataElement(const Tag &t) const
Definition gdcmDataSet.h:188
bool FindDataElement(const PrivateTag &t) const
Look up if private tag 't' is present in the dataset:
const DataSet & GetDataSet() const
Get Data Set.
Definition gdcmFile.h:57
Class to represent an Item.
Definition gdcmItem.h:46
const DataSet & GetNestedDataSet() const
Definition gdcmItem.h:80
Reader ala DOM (Document Object Model)
Definition gdcmReader.h:54
const File & GetFile() const
Set/Get File.
Definition gdcmReader.h:72
virtual bool Read()
Main function to read a file.
void SetFileName(const char *filename_native)
Class for Smart Pointer.
Definition gdcmSmartPointer.h:40
Class to represent a DICOM Data Element (Attribute) Tag (Group, Element).
Definition gdcmTag.h:39
Definition vtkImageColorViewer.h:73
virtual void Render(void)
virtual void SetInput(vtkImageData *in)
virtual void SetupInteractor(vtkRenderWindowInteractor *)
virtual void SetSize(int a, int b)
static vtkImageColorViewer * New()