# Rebuild gdcm whenever a file starting with vtk* is modified
INCLUDE_REGULAR_EXPRESSION("^vtk.*$")
+
+ if(COMMAND cmake_policy)
+ cmake_policy(SET CMP0003 NEW)
+ endif(COMMAND cmake_policy)
+
+
+
#-----------------------------------------------------------------------------
# Include the VTK library
INCLUDE(${VTK_USE_FILE})
vtkgdcmViewer.cxx
)
+SET(vtkJPEGViewer_SOURCES
+ vtkJPEGViewer.cxx
+)
+
+SET(vtkJPEGViewer2_SOURCES
+ vtkJPEGViewer2.cxx
+)
+
# let's do some APPLE/WIN32 magic here
#IF(WIN32)
# SET(GUI_EXECUTABLE WIN32)
vtkgdcm
vtkRendering
)
+
+ADD_EXECUTABLE(vtkJPEGViewer ${GUI_EXECUTABLE} ${vtkJPEGViewer_SOURCES})
+TARGET_LINK_LIBRARIES( vtkJPEGViewer
+ vtkRendering
+)
+
+ADD_EXECUTABLE(vtkJPEGViewer2 ${GUI_EXECUTABLE} ${vtkJPEGViewer2_SOURCES})
+TARGET_LINK_LIBRARIES( vtkJPEGViewer2
+ vtkgdcm
+ vtkRendering
+)
+
ADD_EXECUTABLE(vtkgdcmViewer2 ${GUI_EXECUTABLE} vtkgdcmViewer2.cxx)
TARGET_LINK_LIBRARIES(vtkgdcmViewer2
vtkgdcm
vtkRendering
)
+
ADD_EXECUTABLE(vtkgdcmSerieViewer ${GUI_EXECUTABLE} vtkgdcmSerieViewer.cxx)
TARGET_LINK_LIBRARIES(vtkgdcmSerieViewer
vtkgdcm
vtkRendering
)
+
ADD_EXECUTABLE(vtkgdcmSerieViewer2 ${GUI_EXECUTABLE} vtkgdcmSerieViewer2.cxx)
TARGET_LINK_LIBRARIES(vtkgdcmSerieViewer2
vtkgdcm
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
IF(NOT GDCM_INSTALL_NO_LIBRARIES)
INSTALL_TARGETS(${GDCM_INSTALL_LIB_DIR} vtkgdcm)
INSTALL_TARGETS(${GDCM_INSTALL_BIN_DIR} vtkgdcmViewer)
- INSTALL_TARGETS(${GDCM_INSTALL_BIN_DIR} vtkgdcmViewer2)
+ INSTALL_TARGETS(${GDCM_INSTALL_BIN_DIR} vtkgdcmViewer)
+
+ # INSTALL_TARGETS(${GDCM_INSTALL_BIN_DIR} vtkJPEGViewer)
+ # INSTALL_TARGETS(${GDCM_INSTALL_BIN_DIR} vtkJPEGViewer2)
+
INSTALL_TARGETS(${GDCM_INSTALL_BIN_DIR} vtkgdcmSerieViewer)
ENDIF(NOT GDCM_INSTALL_NO_LIBRARIES)
Program: gdcm
Module: $RCSfile: vtkGdcmReader.cxx,v $
Language: C++
- Date: $Date: 2009/04/18 14:42:51 $
- Version: $Revision: 1.95 $
+ Date: $Date: 2009/11/03 14:05:23 $
+ Version: $Revision: 1.96 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include <vtkPointData.h>
#include <vtkLookupTable.h>
-vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.95 $")
+vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.96 $")
vtkStandardNewMacro(vtkGdcmReader)
//-----------------------------------------------------------------------------
vtkDebugMacro(<< "32 bits signed image");
this->SetDataScalarTypeToInt();
}
- else if ( ImageType == "FD" )
+ else if ( ImageType == "FD" ) // This is not genuine DICOM, but so usefull
{
vtkDebugMacro(<< "64 bits Double image");
this->SetDataScalarTypeToDouble();
type = file->GetPixelType();
if ( (type != "8U") && (type != "8S")
&& (type != "16U") && (type != "16S")
- && (type != "32U") && (type != "32S") )
+ && (type != "32U") && (type != "32S")
+ && (type != "FD") ) // Not so sure this one is kosher
{
vtkErrorMacro(<< "Bad File Type for file " << filename->c_str() << "\n"
<< " File type found : " << type.c_str()
- << " (might be 8U, 8S, 16U, 16S, 32U, 32S) \n"
+ << " (might be 8U, 8S, 16U, 16S, 32U, 32S, FD) \n"
<< " Removing this file from read files");
file->Delete();
file=NULL;
//if (this->GetFlipY())
src = (unsigned char*)fileH->GetImageData();
//else
+ // very strange, but it doesn't work (I have to memcpy the pixels ?!?)
// dest = (unsigned char*)fileH->GetImageData();
- }
-
+ }
if (this->GetFlipY()) {
unsigned char *dst = dest + planeSize - lineSize;
dst += 2 * planeSize;
}
}
-else
+else // we don't flip (upside down) the image
{
memcpy((void*)dest, (void*)src, numPlanes * numLines * lineSize);
}
Program: gdcm
Module: $RCSfile: vtkGdcmReader.h,v $
Language: C++
- Date: $Date: 2009/04/18 14:42:51 $
- Version: $Revision: 1.36 $
+ Date: $Date: 2009/11/03 14:05:23 $
+ Version: $Revision: 1.37 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
vtkSetMacro(KeepOverlays, bool);
vtkGetMacro(KeepOverlays, bool);
vtkBooleanMacro(KeepOverlays, bool);
-
- vtkSetMacro(FlipY, bool);
- vtkGetMacro(FlipY, bool);
- vtkBooleanMacro(FlipY, bool);
-
+
+// Implementation note: when FileLowerLeft (gdcm2) is set to on the image is not flipped
+// upside down as VTK would expect, use this option only if you know what you are doing.
+ // vtkSetMacro(FileLowerLeft, bool);
+ // vtkGetMacro(FileLowerLeft, bool);
+ // vtkBooleanMacro(FileLowerLeft, bool);
+
+ vtkSetMacro(FlipY, bool);
+ vtkGetMacro(FlipY, bool);
+ vtkBooleanMacro(FlipY, bool);
+
vtkGetObjectMacro(LookupTable, vtkLookupTable);
// FIXME : HOW to doxygen a VTK macro?
bool KeepOverlays;
+ // bool FileLowerLeft;
bool FlipY;
-
/// Pointer to a user suplied function to allow modification of pixel order
VOID_FUNCTION_PUINT8_PFILE_POINTER UserFunction;
Program: gdcm
Module: $RCSfile: vtkgdcmViewer.cxx,v $
Language: C++
- Date: $Date: 2007/09/18 07:54:30 $
- Version: $Revision: 1.31 $
+ 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
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();
Program: gdcm
Module: $RCSfile: vtkgdcmViewer2.cxx,v $
Language: C++
- Date: $Date: 2009/04/18 14:42:51 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2009/11/03 14:05:23 $
+ Version: $Revision: 1.17 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#endif
};
+// --------------------------------------------------------------------------------
int main(int argc, char *argv[])
{