+# ---------------------------------
+#
+# Unless you are an experimented cmake user,
+# have a look at :
+# http://www.creatis.insa-lyon.fr/site/fr/CreatoolsGettingStarted-v2.0.X
+# before starting.
+#
+# ---------------------------------
+
PROJECT(GDCM)
CMAKE_MINIMUM_REQUIRED(VERSION 2.0)
# okay in fact you need at least cmake 2.0.4 to get swig working properly
${GDCM_BINARY_DIR}/src)
SET(EXAMPLE_SOURCES
#names starting with 'ex' are examples
- #-------------------------------------
+ #-------------------------------------
#SingleFrames2Multiframe
#Txt2Mat
#exDicomRTStructSetFile
Program: gdcm
Module: $RCSfile: MergeDICOMRaw.cxx,v $
Language: C++
- Date: $Date: 2010/09/01 14:41:48 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2011/03/29 07:35:57 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// TODO
// for UltrasoundMultiframeImageStorage we may need also:
- // (0028,0009) AT (0018,1063) # 4, 1 FrameIncrementPointer
+ // (0028,0009) AT (0018,1063) # 4, 1 FrameIncrementPointer
// and
// Pixel Aspect Ratio
Program: gdcm
Module: $RCSfile: PcpdenseToDicom.cxx,v $
Language: C++
- Date: $Date: 2010/09/01 14:41:48 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2011/03/29 07:35:57 $
+ 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
// === Ecc ===
strSerieUID = GDCM_NAME_SPACE::Util::CreateUniqueUID();
-
+
serieDescr = "Ecc";
-
+
if (!multiframe) {
for (int i=0; i<numberOfSlices; i++)
// === perf ===
strSerieUID = GDCM_NAME_SPACE::Util::CreateUniqueUID();
-
+
serieDescr = "perf";
-
if (!multiframe) {
for (int i=0; i<numberOfSlices; i++)
{
strSerieUID = GDCM_NAME_SPACE::Util::CreateUniqueUID();
-
- serieDescr = "WashoutTc";
+
+ serieDescr = "WashoutTc";
if (multiframe) {
for (int i=0; i<numberOfSlices; i++)
Program: gdcm
Module: $RCSfile: SplitIntoXCoherentDirectories.cxx,v $
Language: C++
- Date: $Date: 2009/05/28 15:44:34 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2011/03/29 07:35:58 $
+ Version: $Revision: 1.5 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
" tag : group-elem (in hexa, no space) ",
" the user wants to split on ",
" sort : user wants FileHelper to sort the images ",
- " Warning : will probabely crah if sort has no meaning ",
+ " Warning : will probabely crash if sort has no meaning ",
" (not only look at image names) ",
" studyUID : *aware* user wants to add the serie ",
" to an already existing study ",
s->SetLoadMode(GDCM_NAME_SPACE::LD_ALL); // Load everything for each File
s->SetDirectory(dirName, true); // true : recursive exploration
-
- GDCM_NAME_SPACE::File *f;
GDCM_NAME_SPACE::DirList dirlist(dirName, true); // recursive exploration
GDCM_NAME_SPACE::DirListType fileNames = dirlist.GetFilenames();
-
GDCM_NAME_SPACE::FileList *l = new GDCM_NAME_SPACE::FileList;
+
+ GDCM_NAME_SPACE::File *f;
// Loop on all the gdcm-readable files
for (GDCM_NAME_SPACE::DirListType::iterator it = fileNames.begin();
it != fileNames.end();
Program: gdcm
Module: $RCSfile: SplitIntoXCoherentDirectoriesIgnoreSerieUID.cxx,v $
Language: C++
- Date: $Date: 2009/05/28 15:44:34 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2011/03/29 07:35:58 $
+ Version: $Revision: 1.3 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
" tag : group-elem (in hexa, no space) ",
" the user wants to split on ",
" sort : user wants FileHelper to sort the images ",
- " Warning : will probabely crah if sort has no meaning ",
+ " Warning : will probabely crash if sort has no meaning ",
" (not only look at image names) ",
" studyUID : *aware* user wants to add the serie ",
" to an already existing study ",
Program: gdcm
Module: $RCSfile: ToMRIregister.cxx,v $
Language: C++
- Date: $Date: 2007/10/24 08:03:44 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2011/03/29 07:35:58 $
+ 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
"\n ToMriregister :\n ",
" - Converts the Siemens Sonata MRI '*tfl2d1' ",
" to be processable by MriRegister software ",
- " - May be used as a template for GDCM_NAME_SPACE::SerieHelper use. ",
+ " - May be used as a template for GDCM_NAME_SPACE::SerieHelper use. ",
" ",
"usage: ToMriRegister dirin=inputDirectoryName ",
" dirout=outputDirectoryName ",
Program: gdcm
Module: $RCSfile: gdcmDataEntry.cxx,v $
Language: C++
- Date: $Date: 2010/07/09 09:20:20 $
- Version: $Revision: 1.56 $
+ Date: $Date: 2011/03/29 07:36:00 $
+ Version: $Revision: 1.57 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
/// \todo rewrite the whole method, in order *not to use* std::string !
std::vector<std::string> tokens;
-
+
Util::Tokenize ( GetString().c_str(), tokens, "\\" );
int nbValues= tokens.size();
else
for (loop=0; loop<nbValues; loop++)
valueVector.push_back(atoi(tokens[loop].c_str()));
-
+
return true;
}
uint32_t nbValues = GetValueCount();
if (nbValues == 0)
return false;
-
+
if( vr == "US") {
for (loop=0; loop<nbValues; loop++)
valueVector.push_back(((uint16_t *)BinArea)[loop]);
Program: gdcm
Module: $RCSfile: gdcmDataEntry.h,v $
Language: C++
- Date: $Date: 2009/02/05 09:50:09 $
- Version: $Revision: 1.22 $
+ Date: $Date: 2011/03/29 07:36:00 $
+ Version: $Revision: 1.23 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
=========================================================================*/
-#ifndef G_DCMDATAENTRY_H_
+#ifndef _GDCMDATAENTRY_H_
#define _GDCMDATAENTRY_H_
#include "gdcmDocEntry.h"
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2010/07/09 09:20:21 $
- Version: $Revision: 1.385 $
+ Date: $Date: 2011/03/29 07:36:00 $
+ Version: $Revision: 1.386 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::cout << std::dec <<"(long)(Fp->tellg()) " << (long)(Fp->tellg()) // in Debug mode
<< std::hex << " 0x(" <<(long)(Fp->tellg()) << ")" << std::endl;
-
// if ( !delim_mode && ((long)(Fp->tellg())-offset) >= l_max) // Once per DocEntry
if ( !delim_mode ) // 'and then' doesn't exist in C++ :-(
if ( ((long)(Fp->tellg())-offset) >= l_max) // Once per DocEntry, when no delim mode
Program: gdcm
Module: $RCSfile: gdcmSerieHelper.cxx,v $
Language: C++
- Date: $Date: 2010/04/09 15:38:18 $
- Version: $Revision: 1.70 $
+ Date: $Date: 2011/03/29 07:36:00 $
+ Version: $Revision: 1.71 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
-
+
=========================================================================*/
#include "gdcmSerieHelper.h"
* \return std::map of 'Xcoherent' File sets
*/
-XCoherentFileSetmap SerieHelper::SplitOnTagValue(FileList *fileSet,
+XCoherentFileSetmap SerieHelper::SplitOnTagValue(FileList *fileSet,
uint16_t group, uint16_t element)
{
XCoherentFileSetmap CoherentFileSet;
int nb = fileSet->size();
if (nb == 0 ) {
- gdcmWarningMacro("Empty FileList passed to SplitOnPosition");
+ gdcmWarningMacro("Empty FileList passed to SplitOnTagValue");
return CoherentFileSet;
}
// 0020,0030 : Image Position (RET)
strTagValue = (*it)->GetEntryString(group,element);
+
+ if ( CoherentFileSet.count(strTagValue) == 0 )
+ {
+ gdcmDebugMacro(" :[" << strTagValue << "]");
+ // create a File set in 'position' position
+ CoherentFileSet[strTagValue] = new FileList;
+ }
+ // Current Tag value and DICOM header match; add the file:
+ CoherentFileSet[strTagValue]->push_back( (*it) );
+ }
+ return CoherentFileSet;
+}
+
+
+/**
+ * \brief Splits a 'Single SerieUID' File set Coherent according to the
+ * value of a given Tag
+ * @param fileSet File Set to be splitted
+ * @param group group number of the target Element
+ * @param element element number of the target Element
+ * \return std::map of 'Xcoherent' File sets
+ */
+
+XCoherentFileSetmap SerieHelper::SplitOnTagValueConvertToFloat(FileList *fileSet,
+ uint16_t group, uint16_t element)
+{
+ XCoherentFileSetmap CoherentFileSet;
+
+ int nb = fileSet->size();
+ if (nb == 0 ) {
+ gdcmWarningMacro("Empty FileList passed to SplitOnTagValue");
+ return CoherentFileSet;
+ }
+
+ std::string strTagValue; // read on disc
+
+ double dTagValue;
+ int iTagValue;
+ char cTagValue[11];
+ std::string sTagValue;
+
+ FileList::const_iterator it = fileSet->begin();
+ //it ++;
+ for ( ;
+ it != fileSet->end();
+ ++it)
+ {
+ /// \TODO : find a trick to create a string whose value follows lexicographical order
+
+ strTagValue = (*it)->GetEntryString(group,element);
+ dTagValue = atof( strTagValue.c_str());
+ iTagValue = dTagValue;
+ sprintf(cTagValue, "%010d", iTagValue);
+ strTagValue = cTagValue;
if ( CoherentFileSet.count(strTagValue) == 0 )
{
Program: gdcm
Module: $RCSfile: gdcmSerieHelper.h,v $
Language: C++
- Date: $Date: 2010/04/09 15:38:18 $
- Version: $Revision: 1.46 $
+ Date: $Date: 2011/03/29 07:36:00 $
+ Version: $Revision: 1.47 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
void OrderFileList(FileList *fileSet);
void Clear() { ClearAll(); }
+ bool UserOrdering(FileList *fileSet);
+ bool ImagePositionPatientOrdering(FileList *fileSet);
+ bool ImageNumberOrdering(FileList *fileSet);
+ bool FileNameOrdering(FileList *fileSet);
+
/// \brief Gets the FIRST Single SerieUID Fileset.
/// Deprecated; kept not to break the API
/// \note Caller must call OrderFileList first
XCoherentFileSetmap SplitOnPosition(FileList *fileSet);
XCoherentFileSetmap SplitOnTagValue(FileList *fileSet,
uint16_t group, uint16_t element);
+ XCoherentFileSetmap SplitOnTagValueConvertToFloat(FileList *fileSet,
+ uint16_t group, uint16_t element);
protected :
SerieHelper();
private:
void ClearAll();
+
+ /*
+ //move them to public (usefull for aware user!)
bool UserOrdering(FileList *fileSet);
bool ImagePositionPatientOrdering(FileList *fileSet);
bool ImageNumberOrdering(FileList *fileSet);
bool FileNameOrdering(FileList *fileSet);
-
+ */
static bool ImageNumberLessThan(File *file1, File *file2);
static bool ImageNumberGreaterThan(File *file1, File *file2);
static bool FileNameLessThan(File *file1, File *file2);
vtkGdcmWriter.cxx
vtkImageColorViewer.cxx
vtkImageMapToWindowLevelColors2.cxx
+ # vtkGdcm4DSplitter.cxx
)
ELSE("${VTK_MAJOR_VERSION}" GREATER 4)
SET(VTKGDCM_LIB_SRCS
SET(Bmp2Dcm_SOURCES
Bmp2Dcm.cxx
)
+
ADD_EXECUTABLE(Bmp2Dcm ${Bmp2Dcm_SOURCES})
TARGET_LINK_LIBRARIES(Bmp2Dcm
vtkgdcm
vtkImaging
-
)
#-----------------------------------------------------------------------------
vtkRendering
)
-
#-----------------------------------------------------------------------------
SET(vtkWriteDicom_SOURCES
vtkWriteDicom.cxx
INSTALL_TARGETS(${GDCM_INSTALL_LIB_DIR} vtkgdcm)
INSTALL_TARGETS(${GDCM_INSTALL_BIN_DIR} vtkgdcmViewer)
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: 2010/09/01 13:33:36 $
- Version: $Revision: 1.98 $
+ Date: $Date: 2011/03/29 07:36:02 $
+ Version: $Revision: 1.99 $
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.98 $")
+vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.99 $")
vtkStandardNewMacro(vtkGdcmReader)
//-----------------------------------------------------------------------------
src = (unsigned char*)fileH->GetImageData();
//else
// very strange, but it doesn't work (I have to memcpy the pixels ?!?)
- // dest = (unsigned char*)fileH->GetImageData();
+ // dest = (unsigned char*)fileH->GetImageData();
}
if (this->GetFlipY()) {
Program: gdcm
Module: $RCSfile: vtkGdcmReader.h,v $
Language: C++
- Date: $Date: 2010/09/01 13:33:36 $
- Version: $Revision: 1.38 $
+ Date: $Date: 2011/03/29 07:36:02 $
+ Version: $Revision: 1.39 $
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);
-
+
// 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 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: 2009/11/03 14:05:23 $
- Version: $Revision: 1.32 $
+ Date: $Date: 2011/03/29 07:36:02 $
+ Version: $Revision: 1.33 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
iren->Start();
//if you wish you can export dicom to a vtk file
-
vtkStructuredPointsWriter *writer = vtkStructuredPointsWriter::New();
writer->SetInput( reader->GetOutput());
writer->SetFileName( "foo.vtk" );
Program: gdcm
Module: $RCSfile: vtkgdcmViewer2.cxx,v $
Language: C++
- Date: $Date: 2010/09/01 13:33:36 $
- Version: $Revision: 1.18 $
+ Date: $Date: 2011/03/29 07:36:02 $
+ Version: $Revision: 1.19 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
if( argc < 2 )
return 0;
-
+
bool metaWrite = false;
vtkGdcmReader *reader = vtkGdcmReader::New();
argc--; // Is it allowed?!?
reader->SetKeepOverlays(true);
}
-
+
// not a very clever way to pass several params
// but it's just for checking
if (strcmp (argv[argc-1], "n") == 0)
argc--; // Is it allowed?!?
metaWrite = true;
}
-
+
if( argc == 2 )
reader->SetFileName( argv[1] );
else
//w->Delete();
std::cout << "end write .mhd" << std::endl;
//}
-
-
+
vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
#if VTK_MAJOR_VERSION >= 5
vtkImageColorViewer *viewer = vtkImageColorViewer::New();
writer->SetFileName( "foo.vtk" );
writer->SetFileTypeToBinary();
//writer->Write();
-
+
//if you wish you can export dicom to a .mhd file
/*
if (metaWrite) {