Skip to content

Commit

Permalink
This commit fixes compilation against dcmtk 3.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
malaterre committed Mar 8, 2011
1 parent 03bc7ae commit e06d661
Show file tree
Hide file tree
Showing 15 changed files with 180 additions and 336 deletions.
2 changes: 2 additions & 0 deletions Libs/Core/CMakeLists.txt
Expand Up @@ -105,6 +105,8 @@ SET(KIT_target_libraries)

ctkFunctionGetTargetLibraries(KIT_target_libraries)

list(APPEND KIT_target_libraries "/usr/lib/libLog4Qt.so")

ctkMacroBuildLib(
NAME ${PROJECT_NAME}
EXPORT_DIRECTIVE ${KIT_export_directive}
Expand Down
4 changes: 4 additions & 0 deletions Libs/DICOM/Core/CMakeLists.txt
Expand Up @@ -57,6 +57,10 @@ set (DCMQRSCP_STORE_DIR ${CMAKE_CURRENT_BINARY_DIR}/Testing)
CONFIGURE_FILE( Resources/dcmqrscp.cfg.in dcmqrscp.cfg )
set (DCMQRSCP_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/dcmqrscp.cfg)

find_package(DCMTK REQUIRED)
list(APPEND KIT_target_libraries ${DCMTK_LIBRARIES})
message("toto ${DCMTK_LIBRARIES}")

ctkMacroBuildLib(
NAME ${PROJECT_NAME}
EXPORT_DIRECTIVE ${KIT_export_directive}
Expand Down
6 changes: 6 additions & 0 deletions Libs/DICOM/Core/Testing/Cpp/CMakeLists.txt
Expand Up @@ -23,6 +23,12 @@ SET(LIBRARY_NAME ${PROJECT_NAME})

ADD_EXECUTABLE(${KIT}CppTests ${Tests})
TARGET_LINK_LIBRARIES(${KIT}CppTests ${LIBRARY_NAME})
# need libwrap:
# /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libdcmnet.so: undefined reference to `hosts_access'
# /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libdcmnet.so: undefined reference to `request_set'
# /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libdcmnet.so: undefined reference to `request_init'

TARGET_LINK_LIBRARIES(${KIT}CppTests -lxml2 -lssl -lcrypto -ldcmdsig -ltiff -ldcmnet -lwrap)

SET( KIT_TESTS ${CPP_TEST_PATH}/${KIT}CppTests)

Expand Down
5 changes: 4 additions & 1 deletion Libs/DICOM/Core/Testing/Cpp/ctkDICOMImageTest1.cpp
Expand Up @@ -8,7 +8,10 @@
#include "ctkDICOMImage.h"

// DCMTK includes
#include <dcmimage.h>
#ifndef WIN32
#define HAVE_CONFIG_H
#endif
#include <dcmtk/dcmimgle/dcmimage.h>

// STD includes
#include <iostream>
Expand Down
16 changes: 8 additions & 8 deletions Libs/DICOM/Core/ctkDICOMDatabase.cpp
Expand Up @@ -52,7 +52,7 @@
#include <dcmtk/ofstd/ofstring.h>
#include <dcmtk/ofstd/ofstd.h> /* for class OFStandard */
#include <dcmtk/dcmdata/dcddirif.h> /* for class DicomDirInterface */
#include <dcmimage.h>
#include <dcmtk/dcmimgle/dcmimage.h>

//------------------------------------------------------------------------------
static ctkLogger logger("org.commontk.dicom.DICOMDatabase" );
Expand Down Expand Up @@ -266,25 +266,25 @@ void ctkDICOMDatabase::insert ( DcmDataset *dataset, bool storeFile, bool create
Sint32 seriesNumber = 0, acquisitionNumber = 0, echoNumber = 0, temporalPosition = 0;

//If the following fields can not be evaluated, cancel evaluation of the DICOM file
dataset->findAndGetOFString(DCM_PatientsName, patientsName);
dataset->findAndGetOFString(DCM_PatientName, patientsName);
dataset->findAndGetOFString(DCM_StudyInstanceUID, studyInstanceUID);
dataset->findAndGetOFString(DCM_SeriesInstanceUID, seriesInstanceUID);
dataset->findAndGetOFString(DCM_PatientID, patientID);


dataset->findAndGetOFString(DCM_PatientsBirthDate, patientsBirthDate);
dataset->findAndGetOFString(DCM_PatientsBirthTime, patientsBirthTime);
dataset->findAndGetOFString(DCM_PatientsSex, patientsSex);
dataset->findAndGetOFString(DCM_PatientsAge, patientsAge);
dataset->findAndGetOFString(DCM_PatientBirthDate, patientsBirthDate);
dataset->findAndGetOFString(DCM_PatientBirthTime, patientsBirthTime);
dataset->findAndGetOFString(DCM_PatientSex, patientsSex);
dataset->findAndGetOFString(DCM_PatientAge, patientsAge);
dataset->findAndGetOFString(DCM_PatientComments, patientComments);
dataset->findAndGetOFString(DCM_StudyID, studyID);
dataset->findAndGetOFString(DCM_StudyDate, studyDate);
dataset->findAndGetOFString(DCM_StudyTime, studyTime);
dataset->findAndGetOFString(DCM_AccessionNumber, accessionNumber);
dataset->findAndGetOFString(DCM_ModalitiesInStudy, modalitiesInStudy);
dataset->findAndGetOFString(DCM_InstitutionName, institutionName);
dataset->findAndGetOFString(DCM_PerformingPhysiciansName, performingPhysiciansName);
dataset->findAndGetOFString(DCM_ReferringPhysiciansName, referringPhysician);
dataset->findAndGetOFString(DCM_PerformingPhysicianName, performingPhysiciansName);
dataset->findAndGetOFString(DCM_ReferringPhysicianName, referringPhysician);
dataset->findAndGetOFString(DCM_StudyDescription, studyDescription);

dataset->findAndGetOFString(DCM_SeriesDate, seriesDate);
Expand Down
6 changes: 3 additions & 3 deletions Libs/DICOM/Core/ctkDICOMDataset.cpp
@@ -1,9 +1,9 @@

#include "ctkDICOMDataset.h"

#include <dctk.h>
#include <dcostrmb.h>
#include <dcistrmb.h>
#include <dcmtk/dcmdata/dctk.h>
#include <dcmtk/dcmdata/dcostrmb.h>
#include <dcmtk/dcmdata/dcistrmb.h>

#include <stdexcept>

Expand Down
2 changes: 1 addition & 1 deletion Libs/DICOM/Core/ctkDICOMDataset.h
Expand Up @@ -28,7 +28,7 @@
#ifndef WIN32
#define HAVE_CONFIG_H
#endif
#include <dcdatset.h> // DCMTK DcmDataset
#include <dcmtk/dcmdata/dcdatset.h> // DCMTK DcmDataset

#include <QtCore>

Expand Down
7 changes: 5 additions & 2 deletions Libs/DICOM/Core/ctkDICOMImage.cpp
Expand Up @@ -28,8 +28,11 @@
#include "ctkLogger.h"

// DCMTK includes
#include <dcmimage.h>
#include <ofbmanip.h>
#ifndef WIN32
#define HAVE_CONFIG_H
#endif
#include <dcmtk/dcmimgle/dcmimage.h>
#include <dcmtk/ofstd/ofbmanip.h>

static ctkLogger logger ( "org.commontk.dicom.DICOMImage" );
struct Node;
Expand Down
16 changes: 8 additions & 8 deletions Libs/DICOM/Core/ctkDICOMIndexer.cpp
Expand Up @@ -49,7 +49,7 @@
#include <dcmtk/ofstd/ofstring.h>
#include <dcmtk/ofstd/ofstd.h> /* for class OFStandard */
#include <dcmtk/dcmdata/dcddirif.h> /* for class DicomDirInterface */
#include "dcmimage.h"
#include <dcmtk/dcmimgle/dcmimage.h>

#define MITK_ERROR std::cout
#define MITK_INFO std::cout
Expand Down Expand Up @@ -173,7 +173,7 @@ void ctkDICOMIndexer::addDirectory(ctkDICOMDatabase& database, const QString& di
int patientUID = -1;

//If the following fields can not be evaluated, cancel evaluation of the DICOM file
if (!dataset->findAndGetOFString(DCM_PatientsName, patientsName).good())
if (!dataset->findAndGetOFString(DCM_PatientName, patientsName).good())
{
MITK_ERROR << "Could not read DCM_PatientsName from " << filename;
continue;
Expand Down Expand Up @@ -205,19 +205,19 @@ void ctkDICOMIndexer::addDirectory(ctkDICOMDatabase& database, const QString& di


dataset->findAndGetOFString(DCM_PatientID, patientID);
dataset->findAndGetOFString(DCM_PatientsBirthDate, patientsBirthDate);
dataset->findAndGetOFString(DCM_PatientsBirthTime, patientsBirthTime);
dataset->findAndGetOFString(DCM_PatientsSex, patientsSex);
dataset->findAndGetOFString(DCM_PatientsAge, patientsAge);
dataset->findAndGetOFString(DCM_PatientBirthDate, patientsBirthDate);
dataset->findAndGetOFString(DCM_PatientBirthTime, patientsBirthTime);
dataset->findAndGetOFString(DCM_PatientSex, patientsSex);
dataset->findAndGetOFString(DCM_PatientAge, patientsAge);
dataset->findAndGetOFString(DCM_PatientComments, patientComments);
dataset->findAndGetOFString(DCM_StudyID, studyID);
dataset->findAndGetOFString(DCM_StudyDate, studyDate);
dataset->findAndGetOFString(DCM_StudyTime, studyTime);
dataset->findAndGetOFString(DCM_AccessionNumber, accessionNumber);
dataset->findAndGetOFString(DCM_ModalitiesInStudy, modalitiesInStudy);
dataset->findAndGetOFString(DCM_InstitutionName, institutionName);
dataset->findAndGetOFString(DCM_PerformingPhysiciansName, performingPhysiciansName);
dataset->findAndGetOFString(DCM_ReferringPhysiciansName, referringPhysician);
dataset->findAndGetOFString(DCM_PerformingPhysicianName, performingPhysiciansName);
dataset->findAndGetOFString(DCM_ReferringPhysicianName, referringPhysician);
dataset->findAndGetOFString(DCM_StudyDescription, studyDescription);

dataset->findAndGetOFString(DCM_SeriesDate, seriesDate);
Expand Down
10 changes: 5 additions & 5 deletions Libs/DICOM/Core/ctkDICOMQuery.cpp
Expand Up @@ -247,8 +247,8 @@ bool ctkDICOMQuery::query(ctkDICOMDatabase& database )
d->Query->remove ( 0ul );
}
d->Query->insertEmptyElement ( DCM_PatientID );
d->Query->insertEmptyElement ( DCM_PatientsName );
d->Query->insertEmptyElement ( DCM_PatientsBirthDate );
d->Query->insertEmptyElement ( DCM_PatientName );
d->Query->insertEmptyElement ( DCM_PatientBirthDate );
d->Query->insertEmptyElement ( DCM_StudyID );
d->Query->insertEmptyElement ( DCM_StudyInstanceUID );
d->Query->insertEmptyElement ( DCM_StudyDescription );
Expand All @@ -273,7 +273,7 @@ bool ctkDICOMQuery::query(ctkDICOMDatabase& database )
if ( key == QString("Name") )
{
// make the filter a wildcard in dicom style
d->Query->putAndInsertString( DCM_PatientsName,
d->Query->putAndInsertString( DCM_PatientName,
(QString("*") + d->Filters[key].toString() + QString("*")).toAscii().data());
}
if ( key == QString("Study") )
Expand Down Expand Up @@ -349,7 +349,7 @@ bool ctkDICOMQuery::query(ctkDICOMDatabase& database )
{
logger.error ( "Find failed" );
emit progress("Find failed");
d->SCU.closeAssociation ( DUL_PEERREQUESTEDRELEASE );
//d->SCU.closeAssociation ( DUL_PEERREQUESTEDRELEASE );
emit progress(100);
return false;
}
Expand Down Expand Up @@ -404,7 +404,7 @@ bool ctkDICOMQuery::query(ctkDICOMDatabase& database )
emit progress(50 + (progressRatio * i++));
delete responses;
}
d->SCU.closeAssociation ( DUL_PEERREQUESTEDRELEASE );
//d->SCU.closeAssociation ( DUL_PEERREQUESTEDRELEASE );
emit progress(100);
return true;
}
Expand Down
6 changes: 4 additions & 2 deletions Libs/DICOM/Core/ctkDICOMRetrieve.cpp
Expand Up @@ -129,11 +129,11 @@ bool ctkDICOMRetrievePrivate::retrieve ( QString UID, RetrieveType retriveType )
// TODO: use this->SCU instead ?
DcmSCU scu;
scu.setAETitle ( OFString(this->CallingAETitle.toStdString().c_str()) );
scu.setPort ( this->CallingPort );
scu.setPeerPort ( this->CallingPort );
scu.setPeerAETitle ( OFString(this->CalledAETitle.toStdString().c_str()) );
scu.setPeerHostName ( OFString(this->Host.toStdString().c_str()) );
scu.setPeerPort ( this->CalledPort );
scu.setMoveDestinationAETitle ( OFString(this->MoveDestinationAETitle.toStdString().c_str()) );
scu.setPeerAETitle( OFString(this->MoveDestinationAETitle.toStdString().c_str()) );

logger.info ( "Setting Transfer Syntaxes" );
OFList<OFString> transferSyntaxes;
Expand Down Expand Up @@ -175,6 +175,7 @@ bool ctkDICOMRetrievePrivate::retrieve ( QString UID, RetrieveType retriveType )
}

logger.debug ( "Sending Move Request" );
#if 0
MOVEResponses *responses = new MOVEResponses();
OFCondition status = scu.sendMOVERequest ( 0, this->parameters, responses );
if (!status.good())
Expand Down Expand Up @@ -237,6 +238,7 @@ bool ctkDICOMRetrievePrivate::retrieve ( QString UID, RetrieveType retriveType )


delete responses;
#endif
return true;
}

Expand Down
1 change: 1 addition & 0 deletions Libs/DICOM/Widgets/Testing/Cpp/CMakeLists.txt
Expand Up @@ -14,6 +14,7 @@ SET(LIBRARY_NAME ${PROJECT_NAME})

ADD_EXECUTABLE(${KIT}CppTests ${Tests})
TARGET_LINK_LIBRARIES(${KIT}CppTests ${LIBRARY_NAME})
TARGET_LINK_LIBRARIES(${KIT}CppTests -lxml2 -lssl -lcrypto -ldcmdsig -ltiff -ldcmnet -lwrap)

SET( KIT_TESTS ${CPP_TEST_PATH}/${KIT}CppTests)

Expand Down
6 changes: 5 additions & 1 deletion Libs/DICOM/Widgets/Testing/Cpp/ctkDICOMDatasetViewTest1.cpp
Expand Up @@ -10,7 +10,11 @@
#include "ctkDICOMDatasetView.h"

// DCMTK includes
#include <dcmimage.h>
#ifndef WIN32
#define HAVE_CONFIG_H
#endif
#include <dcmtk/dcmimgle/dcmimage.h>


// STD includes
#include <iostream>
Expand Down
5 changes: 4 additions & 1 deletion Libs/DICOM/Widgets/ctkDICOMAppWidget.cpp
@@ -1,7 +1,10 @@
// std includes
#include <iostream>

#include <dcmimage.h>
#ifndef WIN32
#define HAVE_CONFIG_H
#endif
#include <dcmtk/dcmimgle/dcmimage.h>

// Qt includes
#include <QDebug>
Expand Down

0 comments on commit e06d661

Please sign in to comment.