vtkgdcm
vtkRendering
)
+
+
#-----------------------------------------------------------------------------
SET(vtkWriteDicom_SOURCES
vtkWriteDicom.cxx
)
+SET(vtkWriteDicomExtended_SOURCES
+ vtkWriteDicomExtended.cxx
+)
ADD_EXECUTABLE(vtkWriteDicom ${vtkWriteDicom_SOURCES})
TARGET_LINK_LIBRARIES(vtkWriteDicom
vtkgdcm
vtkIO
vtkRendering
)
-
+ADD_EXECUTABLE(vtkWriteDicomExtended ${vtkWriteDicomExtended_SOURCES})
+TARGET_LINK_LIBRARIES(vtkWriteDicomExtended
+ vtkgdcm
+ vtkIO
+ vtkRendering
+)
#-----------------------------------------------------------------------------
# Install vtk header
INSTALL_FILES(/include/gdcm FILES vtkGdcmReader.h)
Program: gdcm
Module: $RCSfile: vtkGdcmReader.h,v $
Language: C++
- Date: $Date: 2005/08/31 15:54:51 $
- Version: $Revision: 1.29 $
+ Date: $Date: 2006/03/17 14:46:17 $
+ Version: $Revision: 1.30 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
vtkGetObjectMacro(LookupTable, vtkLookupTable);
-// FIXME : HOW to doxygen a VTM macro?
+// FIXME : HOW to doxygen a VTK macro?
/*
* \ brief Sets the LoadMode as a boolean string.
* gdcm.LD_NOSEQ, gdcm.LD_NOSHADOW, gdcm.LD_NOSHADOWSEQ...
Program: gdcm
Module: $RCSfile: vtkGdcmWriter.cxx,v $
Language: C++
- Date: $Date: 2005/10/25 14:52:37 $
- Version: $Revision: 1.26 $
+ Date: $Date: 2006/03/17 14:46:18 $
+ Version: $Revision: 1.27 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#define vtkFloatingPointType float
#endif
-vtkCxxRevisionMacro(vtkGdcmWriter, "$Revision: 1.26 $")
+vtkCxxRevisionMacro(vtkGdcmWriter, "$Revision: 1.27 $")
vtkStandardNewMacro(vtkGdcmWriter)
//-----------------------------------------------------------------------------
this->LookupTable = NULL;
this->FileDimensionality = 3;
this->WriteType = VTK_GDCM_WRITE_TYPE_EXPLICIT_VR;
+ this->GdcmFile = 0;
+ this->ContentType = VTK_GDCM_WRITE_TYPE_USER_OWN_IMAGE;
}
vtkGdcmWriter::~vtkGdcmWriter()
image->GetScalarType() == VTK_DOUBLE )
{
vtkErrorMacro(<< "Bad input type. Scalar type must not be of type "
- << "VTK_FLOAT or VTKDOUBLE (found:"
- << image->GetScalarTypeAsString());
+ << "VTK_FLOAT or VTK_DOUBLE (found:"
+ << image->GetScalarTypeAsString() << ")" );
return;
}
void vtkGdcmWriter::WriteDcmFile(char *fileName, vtkImageData *image)
{
+ gdcm::FileHelper *dcmFile;
+ if ( GdcmFile != 0)
+ dcmFile = gdcm::FileHelper::New(GdcmFile);
+ else
+ dcmFile = gdcm::FileHelper::New();
+
// From here, the write of the file begins
- gdcm::FileHelper *dcmFile = gdcm::FileHelper::New();
-
+
// Set the image informations
SetImageInformation(dcmFile, image);
Program: gdcm
Module: $RCSfile: vtkGdcmWriter.h,v $
Language: C++
- Date: $Date: 2005/03/03 11:39:24 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2006/03/17 14:46:18 $
+ Version: $Revision: 1.7 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#define __vtkGdcmWriter_h
#include "gdcmCommon.h" // To avoid warnings concerning the std
+#include "gdcmFile.h" // for gdcm::File
#include <vtkImageWriter.h>
#include <vtkLookupTable.h>
#include <string>
//-----------------------------------------------------------------------------
+
#define VTK_GDCM_WRITE_TYPE_EXPLICIT_VR 1
#define VTK_GDCM_WRITE_TYPE_IMPLICIT_VR 2
#define VTK_GDCM_WRITE_TYPE_ACR 3
#define VTK_GDCM_WRITE_TYPE_ACR_LIBIDO 4
+#define VTK_GDCM_WRITE_TYPE_USER_OWN_IMAGE 1
+#define VTK_GDCM_WRITE_TYPE_FILTERED_IMAGE 2
+#define VTK_GDCM_WRITE_TYPE_CREATED_IMAGE 3
+#define VTK_GDCM_WRITE_TYPE_UNMODIFIED_PIXELS_IMAGE 4
+
//-----------------------------------------------------------------------------
class VTK_EXPORT vtkGdcmWriter : public vtkImageWriter
{
void SetWriteTypeToDcmExplVR(){SetWriteType(VTK_GDCM_WRITE_TYPE_IMPLICIT_VR);};
void SetWriteTypeToAcr() {SetWriteType(VTK_GDCM_WRITE_TYPE_ACR); };
void SetWriteTypeToAcrLibido(){SetWriteType(VTK_GDCM_WRITE_TYPE_ACR_LIBIDO); };
+
+ void SetContentTypeToUserOwnImage() {SetContentType(VTK_GDCM_WRITE_TYPE_USER_OWN_IMAGE);};
+ void SetContentTypeToFilteredImage() {SetContentType(VTK_GDCM_WRITE_TYPE_FILTERED_IMAGE);};
+ void SetContentTypeToUserCreatedImage() {SetContentType(VTK_GDCM_WRITE_TYPE_CREATED_IMAGE);};
+ void SetContentTypeToUnmodifiedPixelsImage(){SetContentType(VTK_GDCM_WRITE_TYPE_UNMODIFIED_PIXELS_IMAGE);};
+
vtkSetMacro(WriteType, int);
vtkGetMacro(WriteType, int);
const char *GetWriteTypeAsString();
+//BTX
+ vtkSetMacro(GdcmFile, gdcm::File *);
+ vtkGetMacro(GdcmFile, gdcm::File *);
+//ETX
+
+ vtkSetMacro(ContentType, int);
+ vtkGetMacro(ContentType, int);
+
+
protected:
vtkGdcmWriter();
~vtkGdcmWriter();
// Variables
vtkLookupTable *LookupTable;
int WriteType;
+//BTX
+ gdcm::File *GdcmFile;
+//ETX
+ int ContentType;
+
};
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: vtkgdcmViewer2.cxx,v $
Language: C++
- Date: $Date: 2005/08/30 15:13:10 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2006/03/17 14:46:18 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
}
else
{
+
+ // For a single medical image, it would be more efficient to use
+ // 0028|1050 [DS] [Window Center]
+ // 0028|1051 [DS] [Window Width]
+ // but vtkgdcmReader doesn't know about them :-(
+
vtkFloatingPointType *range = reader->GetOutput()->GetScalarRange();
viewer->SetColorLevel (0.5 * (range[1] + range[0]));
viewer->SetColorWindow (range[1] - range[0]);