Commit 65c4bfb4 authored by SCHMITT Louise-Amelie's avatar SCHMITT Louise-Amelie

modifs Pauline

parent f17e58f3
......@@ -66,6 +66,7 @@
#include <itkGiplDataImageWriter.h>
#include <itkVTKDataImageWriter.h>
#include <itkGISDataImageWriter.h>
#include <itkDicomDataImageWriter.h>
#include <dtkLog/dtkLog.h>
#include <itkLogForwarder.h>
......@@ -152,15 +153,16 @@ bool itkDataImagePlugin::initialize()
if (!itkJPEGDataImageReader::registered()) { dtkWarn() << "Unable to register itkJPEGDataImageReader type"; }
if (!itkTIFFDataImageReader::registered()) { dtkWarn() << "Unable to register itkTIFFDataImageReader type"; }
if (!itkPhilipsRECDataImageReader::registered()) { dtkWarn() << "Unable to register itkPhilipsRECDataImageReader type"; }
if (!itkGISDataImageReader::registered()) { dtkWarn() << "Unable to register itkGISDataImageReader type"; }
if (!itkDCMTKDataImageReader::registered()) { dtkWarn() << "Unable to register itkDCMTKDataImageReader type"; }
if (!itkGISDataImageReader::registered()) { dtkWarn() << "Unable to register itkGISDataImageReader type"; }
if (!itkDCMTKDataImageReader::registered()) { dtkWarn() << "Unable to register itkDCMTKDataImageReader type"; }
if (!itkMetaDataImageWriter::registered()) { dtkWarn() << "Unable to register itkMetaDataImageWriter type"; }
if (!itkNiftiDataImageWriter::registered()) { dtkWarn() << "Unable to register itkNiftiDataImageWriter type"; }
if (!itkNrrdDataImageWriter::registered()) { dtkWarn() << "Unable to register itkNrrdDataImageWriter type"; }
if (!itkGiplDataImageWriter::registered()) { dtkWarn() << "Unable to register itkGiplDataImageWriter type"; }
if (!itkVTKDataImageWriter::registered()) { dtkWarn() << "Unable to register itkVTKDataImageWriter type"; }
if (!itkGISDataImageWriter::registered()) { dtkWarn() << "Unable to register itkGISDataImageWriter type"; }
if (!itkGISDataImageWriter::registered()) { dtkWarn() << "Unable to register itkGISDataImageWriter type"; }
if (!itkDicomDataImageWriter::registered()) { dtkWarn() << "Unable to register itkDicomDataImageWriter type"; }
return true;
}
......
......@@ -369,7 +369,8 @@ bool itkDCMTKDataImageReader::readInformation (const QStringList& paths)
// STUDY
//StudyId
medData->setMetaData(medMetaDataKeys::StudyDicomID.key(), d->io->GetStudyID().c_str());
medData->setMetaData(medMetaDataKeys::StudyID.key(), QString::fromLatin1(d->io->GetStudyID().c_str()));
medData->setMetaData(medMetaDataKeys::StudyInstanceUID.key(), d->io->GetStudyInstanceUID().c_str());
medData->setMetaData(medMetaDataKeys::StudyDescription.key(), QString::fromLatin1(d->io->GetStudyDescription().c_str()));
medData->setMetaData(medMetaDataKeys::Institution.key(), QString::fromLatin1(d->io->GetInstitution().c_str()));
medData->setMetaData(medMetaDataKeys::Referee.key(), QString::fromLatin1(d->io->GetReferringPhysicianName().c_str()));
......@@ -378,7 +379,7 @@ bool itkDCMTKDataImageReader::readInformation (const QStringList& paths)
// SERIES
//SeriesID
medData->setMetaData(medMetaDataKeys::SeriesDicomID.key(), d->io->GetSeriesID().c_str());
medData->setMetaData(medMetaDataKeys::SeriesInstanceUID.key(), d->io->GetSeriesInstanceUID().c_str());
medData->setMetaData(medMetaDataKeys::SeriesNumber.key(), d->io->GetSeriesNumber().c_str());
medData->setMetaData(medMetaDataKeys::Modality.key(), d->io->GetModality().c_str());
medData->setMetaData(medMetaDataKeys::Performer.key(), QString::fromLatin1(d->io->GetPerformingPhysicianName().c_str()));
......
This diff is collapsed.
/*=========================================================================
medInria
Copyright (c) INRIA 2013 - 2014. All rights reserved.
See LICENSE.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
=========================================================================*/
#pragma once
#include <itkDataImageWriterBase.h>
#include <itkDataImagePluginExport.h>
class ITKDATAIMAGEPLUGIN_EXPORT itkDicomDataImageWriter: public itkDataImageWriterBase {
public:
itkDicomDataImageWriter();
virtual ~itkDicomDataImageWriter();
virtual QString identifier() const;
virtual QString description() const;
virtual QStringList handled() const;
virtual QStringList supportedFileExtensions() const;
static bool registered();
static dtkAbstractDataWriter * create();
QString sopClassUID(QString modality);
public slots:
virtual bool write(const QString &path);
protected:
template <class PixelType> bool writeDicom(const QString &path);
};
......@@ -32,7 +32,7 @@ namespace medMetaDataKeys {
// STUDY
MEDCORE_EXPORT const Key StudyID("StudyID", "Study ID");
MEDCORE_EXPORT const Key StudyDicomID("StudyDicomID", "Study Dicom ID");
MEDCORE_EXPORT const Key StudyInstanceUID("StudyInstanceUID", "Study Instance UID");
MEDCORE_EXPORT const Key StudyDescription("StudyDescription", "Study Description");
MEDCORE_EXPORT const Key Institution("Institution");
MEDCORE_EXPORT const Key Referee("Referee");
......@@ -41,7 +41,7 @@ namespace medMetaDataKeys {
// SERIES
MEDCORE_EXPORT const Key SeriesID("SeriesID", "Series ID");
MEDCORE_EXPORT const Key SeriesDicomID("SeriesDicomID", "Series Dicom ID");
MEDCORE_EXPORT const Key SeriesInstanceUID("SeriesInstanceUID", "Series Instance UID");
MEDCORE_EXPORT const Key SeriesNumber("SeriesNumber", "Series Number");
MEDCORE_EXPORT const Key Modality("Modality");
MEDCORE_EXPORT const Key Performer("Performer");
......
......@@ -99,7 +99,7 @@ namespace medMetaDataKeys {
// STUDY
extern MEDCORE_EXPORT const Key StudyID;
extern MEDCORE_EXPORT const Key StudyDicomID;
extern MEDCORE_EXPORT const Key StudyInstanceUID;
extern MEDCORE_EXPORT const Key StudyDescription;
extern MEDCORE_EXPORT const Key Institution;
extern MEDCORE_EXPORT const Key Referee;
......@@ -108,7 +108,7 @@ namespace medMetaDataKeys {
// SERIES
extern MEDCORE_EXPORT const Key SeriesID;
extern MEDCORE_EXPORT const Key SeriesDicomID;
extern MEDCORE_EXPORT const Key SeriesInstanceUID;
extern MEDCORE_EXPORT const Key SeriesStoreId;
extern MEDCORE_EXPORT const Key SeriesNumber;
extern MEDCORE_EXPORT const Key Modality;
......
......@@ -232,7 +232,7 @@ void medAbstractDatabaseImporter::importFile ( void )
medData->setMetaData ( medMetaDataKeys::PatientID.key(), QStringList() << patientID );
tmpSeriesUid = medMetaDataKeys::SeriesDicomID.getFirstValue(medData);
tmpSeriesUid = medMetaDataKeys::SeriesInstanceUID.getFirstValue(medData);
if (tmpSeriesUid != currentSeriesUid)
{
......@@ -359,7 +359,7 @@ void medAbstractDatabaseImporter::importFile ( void )
{
// 3.3) a) re-populate missing metadata
// if there is no SeriesDescription, we use the tag Series Instance UID (specific and required)
populateMissingMetadata ( imagemedData, medMetaDataKeys::SeriesDicomID.getFirstValue(imagemedData));
populateMissingMetadata ( imagemedData, medMetaDataKeys::SeriesInstanceUID.getFirstValue(imagemedData));
imagemedData->setMetaData ( medMetaDataKeys::PatientID.key(), QStringList() << patientID );
imagemedData->setMetaData ( medMetaDataKeys::SeriesID.key(), QStringList() << seriesID );
......@@ -581,18 +581,18 @@ void medAbstractDatabaseImporter::populateMissingMetadata ( medAbstractData* med
if ( !medData->hasMetaData ( medMetaDataKeys::StudyID.key() ) )
medData->setMetaData ( medMetaDataKeys::StudyID.key(), QStringList() << "0" );
if ( !medData->hasMetaData ( medMetaDataKeys::StudyDicomID.key() ) )
medData->setMetaData ( medMetaDataKeys::StudyDicomID.key(), QStringList() << "" );
if ( !medData->hasMetaData ( medMetaDataKeys::StudyInstanceUID.key() ) )
medData->setMetaData ( medMetaDataKeys::StudyInstanceUID.key(), QStringList() << "" );
QString generatedSeriesId = QUuid::createUuid().toString().replace("{","").replace("}","");
if ( !medData->hasMetaData ( medMetaDataKeys::SeriesID.key() ) )
medData->setMetaData ( medMetaDataKeys::SeriesID.key(), QStringList() << generatedSeriesId);
QString generatedSeriesDicomID = QUuid::createUuid().toString().replace("{","").replace("}","");
QString generatedSeriesInstanceUID = QUuid::createUuid().toString().replace("{","").replace("}","");
if ( !medData->hasMetaData ( medMetaDataKeys::SeriesDicomID.key() ) )
medData->setMetaData ( medMetaDataKeys::SeriesDicomID.key(), QStringList() << generatedSeriesDicomID );
if ( !medData->hasMetaData ( medMetaDataKeys::SeriesInstanceUID.key() ) )
medData->setMetaData ( medMetaDataKeys::SeriesInstanceUID.key(), QStringList() << generatedSeriesInstanceUID );
if ( !medData->hasMetaData ( medMetaDataKeys::Orientation.key() ) )
medData->setMetaData ( medMetaDataKeys::Orientation.key(), QStringList() << "" );
......@@ -986,7 +986,7 @@ QString medAbstractDatabaseImporter::generateUniqueVolumeId ( const medAbstractD
// Get all the information from the medAbstractData metadata.
// This information will then be passed to the database.
QString patientName = medMetaDataKeys::PatientName.getFirstValue(medData);
QString studyDicomId = medMetaDataKeys::StudyDicomID.getFirstValue(medData);
QString studyDicomId = medMetaDataKeys::StudyInstanceUID.getFirstValue(medData);
// We don't use the seriesDicomID, too unreliable : you can have images part
// of the same series with different UIDs, and different volumes within the
......
......@@ -84,7 +84,7 @@ void medDatabaseControllerPrivate::buildMetaDataLookup()
//Study Data
metaDataLookup.insert(medMetaDataKeys::StudyDescription.key(),
TableEntryList() << TableEntry(T_study, "name") );
metaDataLookup.insert(medMetaDataKeys::StudyDicomID.key(),
metaDataLookup.insert(medMetaDataKeys::StudyInstanceUID.key(),
TableEntryList() << TableEntry(T_study, "uid") );
metaDataLookup.insert(medMetaDataKeys::StudyID.key(),
TableEntryList() << TableEntry(T_study, "studyId") );
......@@ -95,7 +95,7 @@ void medDatabaseControllerPrivate::buildMetaDataLookup()
TableEntryList() << TableEntry(T_series, "name") );
metaDataLookup.insert(medMetaDataKeys::Size.key(),
TableEntryList() << TableEntry(T_series, "size") );
metaDataLookup.insert(medMetaDataKeys::SeriesDicomID.key(),
metaDataLookup.insert(medMetaDataKeys::SeriesInstanceUID.key(),
TableEntryList() << TableEntry(T_series, "uid") );
metaDataLookup.insert(medMetaDataKeys::SeriesID.key(),
TableEntryList() << TableEntry(T_series, "seriesId") );
......
......@@ -108,7 +108,7 @@ bool medDatabaseImporter::checkIfExists ( medAbstractData* medData, QString imag
// if patient already exists we now verify the study
QString studyName = medMetaDataKeys::StudyDescription.getFirstValue(medData);
QString studyUid = medMetaDataKeys::StudyDicomID.getFirstValue(medData);
QString studyUid = medMetaDataKeys::StudyInstanceUID.getFirstValue(medData);
query.prepare ( "SELECT id FROM study WHERE patient = :patient AND name = :name AND uid = :studyID" );
query.bindValue ( ":patient", patientDbId );
......@@ -123,7 +123,7 @@ bool medDatabaseImporter::checkIfExists ( medAbstractData* medData, QString imag
QVariant studyDbId = query.value ( 0 );
// both patient and study exists, let's check series
QString seriesName = medMetaDataKeys::SeriesDescription.getFirstValue(medData);
QString seriesUid = medMetaDataKeys::SeriesDicomID.getFirstValue(medData);
QString seriesUid = medMetaDataKeys::SeriesInstanceUID.getFirstValue(medData);
QString orientation = medMetaDataKeys::Orientation.getFirstValue(medData); // orientation sometimes differ by a few digits, thus this is not reliable
QString seriesNumber = medMetaDataKeys::SeriesNumber.getFirstValue(medData);
QString sequenceName = medMetaDataKeys::SequenceName.getFirstValue(medData);
......@@ -250,7 +250,7 @@ int medDatabaseImporter::getOrCreateStudy ( const medAbstractData* medData, QSql
QSqlQuery query ( db );
QString studyName = medMetaDataKeys::StudyDescription.getFirstValue(medData).simplified();
QString studyUid = medMetaDataKeys::StudyDicomID.getFirstValue(medData);
QString studyUid = medMetaDataKeys::StudyInstanceUID.getFirstValue(medData);
QString studyId = medMetaDataKeys::StudyID.getFirstValue(medData);
QString serieName = medMetaDataKeys::SeriesDescription.getFirstValue(medData).simplified();
......@@ -301,7 +301,7 @@ int medDatabaseImporter::getOrCreateSeries ( const medAbstractData* medData, QSq
QSqlQuery query ( db );
QString seriesName = medMetaDataKeys::SeriesDescription.getFirstValue(medData).simplified();
QString seriesUid = medMetaDataKeys::SeriesDicomID.getFirstValue(medData);
QString seriesUid = medMetaDataKeys::SeriesInstanceUID.getFirstValue(medData);
QString seriesId = medMetaDataKeys::SeriesID.getFirstValue(medData);
QString orientation = medMetaDataKeys::Orientation.getFirstValue(medData);
......
......@@ -531,8 +531,8 @@ medDataIndex medDatabaseNonPersistentController::moveSerie(const medDataIndex& i
QStringList() << dataStudy->metadata( medMetaDataKeys::StudyDescription.key()) );
dataSerie->setMetaData ( medMetaDataKeys::StudyID.key(),
QStringList() << dataStudy->metadata( medMetaDataKeys::StudyID.key()) );
dataSerie->setMetaData ( medMetaDataKeys::StudyDicomID.key(),
QStringList() << dataStudy->metadata( medMetaDataKeys::StudyDicomID.key()) );
dataSerie->setMetaData ( medMetaDataKeys::StudyInstanceUID.key(),
QStringList() << dataStudy->metadata( medMetaDataKeys::StudyInstanceUID.key()) );
serieItem->setName(dataStudy->metadata( medMetaDataKeys::PatientName.key()));
serieItem->setPatientId(dataStudy->metadata( medMetaDataKeys::PatientID.key()));
......
......@@ -154,7 +154,7 @@ medDataIndex medDatabaseNonPersistentImporter::populateDatabaseAndGenerateThumbn
int studyDbId = -1;
QString studyName = medMetaDataKeys::StudyDescription.getFirstValue(data);
QString studyId = medMetaDataKeys::StudyID.getFirstValue(data);
QString studyUid = medMetaDataKeys::StudyDicomID.getFirstValue(data);
QString studyUid = medMetaDataKeys::StudyInstanceUID.getFirstValue(data);
QString seriesName = medMetaDataKeys::SeriesDescription.getFirstValue(data);
......@@ -197,7 +197,7 @@ medDataIndex medDatabaseNonPersistentImporter::populateDatabaseAndGenerateThumbn
medData->setMetaData ( medMetaDataKeys::BirthDate.key(), birthdate );
medData->setMetaData ( medMetaDataKeys::StudyDescription.key(), QStringList() << studyName );
medData->setMetaData ( medMetaDataKeys::StudyID.key(), QStringList() << studyId );
medData->setMetaData ( medMetaDataKeys::StudyDicomID.key(), QStringList() << studyUid );
medData->setMetaData ( medMetaDataKeys::StudyInstanceUID.key(), QStringList() << studyUid );
studyItem->d->name = patientName;
studyItem->d->patientId = patientId;
......@@ -218,7 +218,7 @@ medDataIndex medDatabaseNonPersistentImporter::populateDatabaseAndGenerateThumbn
index = medDataIndex ( npdc->dataSourceId(), patientDbId, studyDbId, npdc->seriesId ( true ), -1 );
QString seriesId = medMetaDataKeys::SeriesID.getFirstValue(data);
QString seriesUid = medMetaDataKeys::SeriesDicomID.getFirstValue(data);
QString seriesUid = medMetaDataKeys::SeriesInstanceUID.getFirstValue(data);
QString orientation = medMetaDataKeys::Orientation.getFirstValue(data);
QString seriesNumber = medMetaDataKeys::SeriesNumber.getFirstValue(data);
QString sequenceName = medMetaDataKeys::SequenceName.getFirstValue(data);
......
......@@ -158,9 +158,9 @@ bool medDatabaseNonPersistentItem::Match(medAbstractData *medData)
{
QString patientName = medMetaDataKeys::PatientName.getFirstValue(medData).simplified();
QString studyName = medMetaDataKeys::StudyDescription.getFirstValue(medData).simplified();
QString studyUid = medMetaDataKeys::StudyDicomID.getFirstValue(medData);
QString studyUid = medMetaDataKeys::StudyInstanceUID.getFirstValue(medData);
QString seriesName = medMetaDataKeys::SeriesDescription.getFirstValue(medData).simplified();
QString seriesUid = medMetaDataKeys::SeriesDicomID.getFirstValue(medData);
QString seriesUid = medMetaDataKeys::SeriesInstanceUID.getFirstValue(medData);
QString orientation = medMetaDataKeys::Orientation.getFirstValue(medData);
QString seriesNumber = medMetaDataKeys::SeriesNumber.getFirstValue(medData);
QString sequenceName = medMetaDataKeys::SequenceName.getFirstValue(medData);
......@@ -178,5 +178,6 @@ bool medDatabaseNonPersistentItem::Match(medAbstractData *medData)
seriesNumber == d->seriesNumber &&
sequenceName == d->sequenceName &&
sliceThickness == d->sliceThickness &&
rows == d->rows );
rows == d->rows &&
columns == d->columns);
}
......@@ -193,10 +193,10 @@ medAbstractData* medDatabaseReader::run()
medMetaDataKeys::Gender.set ( medData, gender );
medMetaDataKeys::StudyDescription.set ( medData, studyName );
medMetaDataKeys::StudyID.set ( medData, studyId );
medMetaDataKeys::StudyDicomID.set ( medData, studyUid );
medMetaDataKeys::StudyInstanceUID.set ( medData, studyUid );
medMetaDataKeys::SeriesDescription.set ( medData, seriesName );
medMetaDataKeys::SeriesID.set ( medData, seriesId );
medMetaDataKeys::SeriesDicomID.set ( medData, seriesUid );
medMetaDataKeys::SeriesInstanceUID.set ( medData, seriesUid );
medMetaDataKeys::Orientation.set ( medData, orientation );
medMetaDataKeys::Columns.set ( medData, columns );
medMetaDataKeys::Rows.set ( medData, rows );
......
......@@ -546,7 +546,7 @@ void medDatabaseView::onCreateStudyRequested(void)
medData->setMetaData ( medMetaDataKeys::StudyDescription.key(), QStringList() << studyName );
medData->setMetaData ( medMetaDataKeys::StudyID.key(), QStringList() << "0" );
medData->setMetaData ( medMetaDataKeys::StudyDicomID.key(), QStringList() << "" );
medData->setMetaData ( medMetaDataKeys::StudyInstanceUID.key(), QStringList() << "" );
medDataManager::instance()->importData(medData, editDialog.isPersistent());
}
......
......@@ -851,12 +851,18 @@ std::string DCMTKImageIO::GetPatientAge() const
return name;
}
std::string DCMTKImageIO::GetStudyID() const
std::string DCMTKImageIO::GetStudyInstanceUID() const
{
std::string name = this->GetMetaDataValueString ( "(0020,000d)", 0 );
return name;
}
std::string DCMTKImageIO::GetStudyID() const
{
std::string name = this->GetMetaDataValueString ( "(0020,0010)", 0 );
return name;
}
std::string DCMTKImageIO::GetPatientDOB() const
{
std::string name = this->GetMetaDataValueString ( "(0010,0030)", 0 );
......@@ -929,7 +935,7 @@ std::string DCMTKImageIO::GetScanOptions() const
return name;
}
std::string DCMTKImageIO::GetSeriesID() const
std::string DCMTKImageIO::GetSeriesInstanceUID() const
{
std::string name = this->GetMetaDataValueString ( "(0020,000e)", 0 );
return name;
......
......@@ -86,6 +86,7 @@ public:
std::string GetPatientID() const;
std::string GetPatientSex() const;
std::string GetPatientAge() const;
std::string GetStudyInstanceUID() const;
std::string GetStudyID() const;
std::string GetPatientDOB() const;
std::string GetStudyDescription() const;
......@@ -107,7 +108,7 @@ public:
std::string GetPatientStatus() const;
// new
std::string GetSeriesID() const;
std::string GetSeriesInstanceUID() const;
std::string GetOrientation() const;
std::string GetSeriesNumber() const;
std::string GetSequenceName() const;
......
......@@ -61,7 +61,7 @@ QStringList medUtilities::metaDataKeysToCopyForDerivedData(medAbstractData* deri
<< medMetaDataKeys::Gender.key()
<< medMetaDataKeys::Description.key()
<< medMetaDataKeys::StudyID.key()
<< medMetaDataKeys::StudyDicomID.key()
<< medMetaDataKeys::StudyInstanceUID.key()
<< medMetaDataKeys::StudyDescription.key()
<< medMetaDataKeys::Institution.key()
<< medMetaDataKeys::Referee.key()
......@@ -103,8 +103,8 @@ void medUtilities::generateSeriesAndSOPInstanceId(medAbstractData* data)
QString generatedSOPInstanceID = QUuid::createUuid().toString().replace("{", "").replace("}", "");
data->setMetaData(medMetaDataKeys::SOPInstanceUID.key(), generatedSOPInstanceID);
QString generatedSeriesDicomID = QUuid::createUuid().toString().replace("{", "").replace("}", "");
data->setMetaData(medMetaDataKeys::SeriesDicomID.key(), generatedSeriesDicomID);
QString generatedSeriesInstanceUID = QUuid::createUuid().toString().replace("{", "").replace("}", "");
data->setMetaData(medMetaDataKeys::SeriesInstanceUID.key(), generatedSeriesInstanceUID);
}
void medUtilities::querySeriesDescription(medAbstractData* data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment