Commit e5ac0a5c authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Adding image converter.

parent 1351860f
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -155,6 +155,23 @@ endif()
#    message( "MPI headers found -- ${MPI_CXX_INCLUDE_PATH}")
#endif()

find_package( DCMTK )
if( DCMTK_FOUND )
   set( HAVE_DCMTK_H "#define HAVE_DCMTK_H" )
   include_directories( ${DCMTK_INCLUDE_DIRS} )
else()
   set( HAVE_DCMTK_H "//#define HAVE_DCMTK_H" )
endif()

find_package( PNG )
if( PNG_FOUND )      
   set( HAVE_PNG_H "#define HAVE_PNG_H" )
   include_directories( ${PNG_INCLUDE_DIRS} )
else()
   set( HAVE_PNG_H "//#define HAVE_PNG_H" )
endif()


####
# Check for some system header
#
+2 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ ADD_SUBDIRECTORY( arrays )
ADD_SUBDIRECTORY( containers )
ADD_SUBDIRECTORY( cuda )
ADD_SUBDIRECTORY( vectors )
ADD_SUBDIRECTORY( io )

set (headers tnlAssert.h               
             tnlConstants.h
@@ -67,6 +68,7 @@ set( tnl_core_SOURCES
     ${tnl_core_cuda_SOURCES}
     ${tnl_core_vectors_SOURCES}
     ${common_SOURCES}
     ${CURRENT_DIR}/tnlCudaDeviceInfo.cpp
     PARENT_SCOPE )
    

+17 −0
Original line number Diff line number Diff line
set( headers  )

SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/core/io )
set( common_SOURCES )       

IF( BUILD_CUDA )
   set( tnl_core_io_CUDA__SOURCES
        ${common_SOURCES}             
        PARENT_SCOPE )
ELSE()
    set( tnl_core_io_SOURCES     
         ${common_SOURCES}          
         PARENT_SCOPE )
ENDIF()    

        
INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/core/io )
 No newline at end of file
+50 −0
Original line number Diff line number Diff line
#include "DicomHeader.h"

DicomHeader::DicomHeader()
{
    fileFormat = new DcmFileFormat();
    isLoaded = false;
    imageInfoObj = new ImageInfoObj(*this);
    patientInfoObj = new PatientInfoObj(*this);
    seriesInfoObj = new SeriesInfoObj(*this);
}

DicomHeader::~DicomHeader()
{
    delete imageInfoObj;
    delete patientInfoObj;
    delete seriesInfoObj;
    delete fileFormat;
}

bool DicomHeader::loadFromFile(const char *fileName)
{
    OFCondition status = fileFormat->loadFile(fileName);
    if(status.good())
    {
        isLoaded = true;
        return true;
    }
    isLoaded = false;
    return false;
}

DcmFileFormat &DicomHeader::getFileFormat()
{
    return *fileFormat;
}

ImageInfoObj &DicomHeader::getImageInfoObj()
{
    return *imageInfoObj;
}

PatientInfoObj &DicomHeader::getPatientInfoObj()
{
    return *patientInfoObj;
}
SeriesInfoObj &DicomHeader::getSeriesInfoObj()
{
    return *seriesInfoObj;
}
+63 −0
Original line number Diff line number Diff line
/***************************************************************************
                          tnlDicomHeader.h  -  description
                             -------------------
    begin                : Jul 19, 2015
    copyright            : (C) 2015 by Jiri Kafka,
                                       Tomas Oberhuber
    email                : tomas.oberhuber@fjfi.cvut.cz
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef TNLDICOMHEADER_H
#define TNLDICOMHEADER_H

#include <dcmtk/dcmdata/dcfilefo.h>
#include <dcmtk/dcmdata/dcdeftag.h>
#include "ImageInfoObj.h"
#include "PatientInfoObj.h"
#include "SeriesInfoObj.h"

/***
 * Class provides acces to the DICOM file header (contains complete
 *   information about DICOM file) and stores the information objects
 *   focused on essential data about image, patient and serie.
 */
class tnlDicomHeader
{
   public:
      
      tnlDicomHeader();
      virtual ~tnlDicomHeader();

      DcmFileFormat &getFileFormat();
      
      ImageInfoObj &getImageInfoObj();
      
      PatientInfoObj &getPatientInfoObj();
      
      SeriesInfoObj &getSeriesInfoObj();

      bool loadFromFile( const char* fileName );

   protected:
      
      ImageInfoObj *imageInfoObj;
      
      PatientInfoObj *patientInfoObj;
      
      SeriesInfoObj *seriesInfoObj;

      DcmFileFormat *fileFormat;
      
      bool isLoaded;
};

#endif // TNLDICOMHEADER_H
Loading