diff --git a/Modules/DicomRT/mitkDicomRTReader.cpp b/Modules/DicomRT/mitkDicomRTReader.cpp index 473001f847..f125931692 100644 --- a/Modules/DicomRT/mitkDicomRTReader.cpp +++ b/Modules/DicomRT/mitkDicomRTReader.cpp @@ -1,547 +1,449 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "mitkDicomRTReader.h" #include #include #include namespace mitk { DicomRTReader::DicomRTReader(){} DicomRTReader::~DicomRTReader(){} DicomRTReader::RoiEntry::RoiEntry() { Number=0; DisplayColor[0]=1.0; DisplayColor[1]=0.0; DisplayColor[2]=0.0; ContourModelSet=mitk::ContourModelSet::New(); } DicomRTReader::RoiEntry::~RoiEntry(){} DicomRTReader::RoiEntry::RoiEntry(const RoiEntry& src) { Number=src.Number; Name=src.Name; Description=src.Description; DisplayColor[0]=src.DisplayColor[0]; DisplayColor[1]=src.DisplayColor[1]; DisplayColor[2]=src.DisplayColor[2]; ContourModelSet=mitk::ContourModelSet::New(); SetPolyData(src.ContourModelSet); } - DicomRTReader::RoiEntry& DicomRTReader::RoiEntry::operator=(const RoiEntry &src) + DicomRTReader::RoiEntry& DicomRTReader::RoiEntry:: + operator=(const RoiEntry &src) { Number=src.Number; Name=src.Name; Description=src.Description; DisplayColor[0]=src.DisplayColor[0]; DisplayColor[1]=src.DisplayColor[1]; DisplayColor[2]=src.DisplayColor[2]; SetPolyData(src.ContourModelSet); return (*this); } - void DicomRTReader::RoiEntry::SetPolyData(mitk::ContourModelSet::Pointer roiPolyData) + void DicomRTReader::RoiEntry:: + SetPolyData(mitk::ContourModelSet::Pointer roiPolyData) { if (roiPolyData == this->ContourModelSet) return; this->ContourModelSet = roiPolyData; } - std::deque DicomRTReader::ReadDicomFile(char* filename) + std::deque DicomRTReader:: + ReadDicomFile(char* filename) { DcmFileFormat file; OFCondition outp; outp = file.loadFile(filename, EXS_Unknown); if(outp.good()) { DcmDataset *dataset = file.getDataset(); OFString sopClass; - if(dataset->findAndGetOFString(DCM_SOPClassUID, sopClass).good() && !sopClass.empty()) + if(dataset->findAndGetOFString + (DCM_SOPClassUID, sopClass).good() && !sopClass.empty()) { if(sopClass == UID_RTDoseStorage) { mitk::DataNode::Pointer x = mitk::DataNode::New(); x = this->DicomRTReader::LoadRTDose(dataset, filename); ContourModelSetVector y; return y; } else if(sopClass == UID_RTStructureSetStorage) { - ContourModelSetVector x = this->DicomRTReader::ReadStructureSet(dataset); + ContourModelSetVector x = + this->DicomRTReader::ReadStructureSet(dataset); return x; } - else if(sopClass == UID_RTPlanStorage) - { -// Function isnt implemented yet -// int x = this->DicomRTReader::LoadRTPlan(dataset); - ContourModelSetVector y; - return y; - } else { - MITK_ERROR << "Error matching the SOP Class, maybe an unsupported type" << endl; + MITK_ERROR << "Error matching SOP Class, maybe an unsupported type" + << endl; ContourModelSetVector y; return y; } } else { MITK_ERROR << "Error reading the SOPClassID" << endl; ContourModelSetVector y; return y; } } else { MITK_ERROR << "Error rading the input file" << endl; ContourModelSetVector y; return y; } } size_t DicomRTReader::GetNumberOfRois() { return this->RoiSequenceVector.size(); } - DicomRTReader::RoiEntry* DicomRTReader::FindRoiByNumber(unsigned int roiNumber) + DicomRTReader::RoiEntry* DicomRTReader::FindRoiByNumber(unsigned int roiNum) { for(unsigned int i=0; iRoiSequenceVector.size(); ++i) { - if(this->RoiSequenceVector[i].Number == roiNumber) + if(this->RoiSequenceVector[i].Number == roiNum) return &this->RoiSequenceVector[i]; } return NULL; } - std::deque DicomRTReader::ReadStructureSet(DcmDataset* dataset) + std::deque DicomRTReader:: + ReadStructureSet(DcmDataset* dataset) { /** * @brief For storing contourmodelsets that belongs to the same object * - * e.g. An eye consists of several contourmodels (contourmodel consists of several 3D-Points) - * and together they are a contourmodelset + * e.g. An eye consists of several contourmodels (contourmodel consists + * of several 3D-Points) and together they are a contourmodelset */ ContourModelSetVector contourModelSetVector; DRTStructureSetIOD structureSetObject; OFCondition outp = structureSetObject.read(*dataset); if(!outp.good()) { MITK_ERROR << "Error reading the file" << endl; std::deque x; return x; } - DRTStructureSetROISequence &roiSequence = structureSetObject.getStructureSetROISequence(); + DRTStructureSetROISequence &roiSequence = + structureSetObject.getStructureSetROISequence(); if(!roiSequence.gotoFirstItem().good()) { MITK_ERROR << "Error reading the structure sequence" << endl; std::deque x; return x; } do{ - DRTStructureSetROISequence::Item ¤tSequence = roiSequence.getCurrentItem(); + DRTStructureSetROISequence::Item ¤tSequence = + roiSequence.getCurrentItem(); if(!currentSequence.isValid()) { continue; } OFString roiName; OFString roiDescription; Sint32 roiNumber; RoiEntry roi; currentSequence.getROIName(roiName); currentSequence.getROIDescription(roiDescription); currentSequence.getROINumber(roiNumber); roi.Name = roiName.c_str(); roi.Description = roiDescription.c_str(); roi.Number = roiNumber; this->RoiSequenceVector.push_back(roi); } while(roiSequence.gotoNextItem().good()); -// Dont know anymore >.< -// OFString refSOPInstUID = GetReferencedFrameOfReferenceSOPInstanceUID(structureSetObject); -// double sliceThickness = 2.0; - Sint32 refRoiNumber; - DRTROIContourSequence &roiContourSeqObject = structureSetObject.getROIContourSequence(); + DRTROIContourSequence &roiContourSeqObject = + structureSetObject.getROIContourSequence(); if(!roiContourSeqObject.gotoFirstItem().good()) { MITK_ERROR << "Error reading the contour sequence" << endl; std::deque x; return x; } do { mitk::ContourModelSet::Pointer contourSet = mitk::ContourModelSet::New(); - DRTROIContourSequence::Item ¤tRoiObject = roiContourSeqObject.getCurrentItem(); + DRTROIContourSequence::Item ¤tRoiObject = + roiContourSeqObject.getCurrentItem(); if(!currentRoiObject.isValid()) { continue; } currentRoiObject.getReferencedROINumber(refRoiNumber); - DRTContourSequence &contourSeqObject = currentRoiObject.getContourSequence(); + DRTContourSequence &contourSeqObject = + currentRoiObject.getContourSequence(); if(contourSeqObject.gotoFirstItem().good()) { do { - DRTContourSequence::Item &contourItem = contourSeqObject.getCurrentItem(); + DRTContourSequence::Item &contourItem = + contourSeqObject.getCurrentItem(); if(!contourItem.isValid()) { continue; } int number; OFString contourNumber; OFString numberOfPoints; OFVector contourData_LPS; - mitk::ContourModel::Pointer contourSequence = mitk::ContourModel::New(); + mitk::ContourModel::Pointer contourSequence = + mitk::ContourModel::New(); contourItem.getContourNumber(contourNumber); contourItem.getNumberOfContourPoints(numberOfPoints); contourItem.getContourData(contourData_LPS); std::stringstream stream; stream << numberOfPoints; stream >> number; for(unsigned int i=0; iAddVertex(point); } contourSequence->Close(); contourSet->AddContourModel(contourSequence); } while(contourSeqObject.gotoNextItem().good()); } else { MITK_ERROR << "Error reading contourSeqObject" << endl; } RoiEntry* refROI = this->FindRoiByNumber(refRoiNumber); if(refROI==NULL) { MITK_ERROR << "Can not find references ROI" << endl; continue; } Sint32 roiColor; for(int j=0;j<3;j++) { currentRoiObject.getROIDisplayColor(roiColor, j); refROI->DisplayColor[j] = roiColor/255.0; } - //TODO check for ordering maybe outsource contourmodelsetvector to - //Roientry and maybe it can replace the ContoruModelSet refROI->ContourModelSet = contourSet; contourSet->SetProperty("name", mitk::StringProperty::New(refROI->Name)); contourModelSetVector.push_back(contourSet); } while(roiContourSeqObject.gotoNextItem().good()); - MITK_INFO << "Number of ROIs found: " << contourModelSetVector.size() << endl; - return contourModelSetVector; } - OFString DicomRTReader::GetReferencedFrameOfReferenceSOPInstanceUID(DRTStructureSetIOD &structSetObject) + OFString DicomRTReader:: + GetRefFrameOfRefSOPInstanceUID(DRTStructureSetIOD &structSetObject) { OFString invalid; - DRTReferencedFrameOfReferenceSequence &refFrameOfRefSeqObject = structSetObject.getReferencedFrameOfReferenceSequence(); + DRTReferencedFrameOfReferenceSequence &refFrameOfRefSeqObject = + structSetObject.getReferencedFrameOfReferenceSequence(); if(!refFrameOfRefSeqObject.gotoFirstItem().good()) return invalid; - DRTReferencedFrameOfReferenceSequence::Item ¤tRefFrameOfRefSeqItem = refFrameOfRefSeqObject.getCurrentItem(); + DRTReferencedFrameOfReferenceSequence::Item ¤tRefFrameOfRefSeqItem = + refFrameOfRefSeqObject.getCurrentItem(); if(!currentRefFrameOfRefSeqItem.isValid()) return invalid; - DRTRTReferencedStudySequence &refStudySeqObject = currentRefFrameOfRefSeqItem.getRTReferencedStudySequence(); + DRTRTReferencedStudySequence &refStudySeqObject = + currentRefFrameOfRefSeqItem.getRTReferencedStudySequence(); if(!refStudySeqObject.gotoFirstItem().good()) return invalid; - DRTRTReferencedStudySequence::Item &refStudySeqItem = refStudySeqObject.getCurrentItem(); + DRTRTReferencedStudySequence::Item &refStudySeqItem = + refStudySeqObject.getCurrentItem(); if(!refStudySeqItem.isValid()) return invalid; - DRTRTReferencedSeriesSequence &refSeriesSeqObject = refStudySeqItem.getRTReferencedSeriesSequence(); + DRTRTReferencedSeriesSequence &refSeriesSeqObject = + refStudySeqItem.getRTReferencedSeriesSequence(); if(!refSeriesSeqObject.gotoFirstItem().good()) return invalid; - DRTRTReferencedSeriesSequence::Item &refSeriesSeqItem = refSeriesSeqObject.getCurrentItem(); + DRTRTReferencedSeriesSequence::Item &refSeriesSeqItem = + refSeriesSeqObject.getCurrentItem(); if(!refSeriesSeqItem.isValid()) return invalid; - DRTContourImageSequence &contourImageSeqObject = refSeriesSeqItem.getContourImageSequence(); + DRTContourImageSequence &contourImageSeqObject = + refSeriesSeqItem.getContourImageSequence(); if(!contourImageSeqObject.gotoFirstItem().good()) return invalid; - DRTContourImageSequence::Item &contourImageSeqItem = contourImageSeqObject.getCurrentItem(); + DRTContourImageSequence::Item &contourImageSeqItem = + contourImageSeqObject.getCurrentItem(); if(!contourImageSeqItem.isValid()) return invalid; OFString resultUid; contourImageSeqItem.getReferencedSOPInstanceUID(resultUid); return resultUid; } - int DicomRTReader::LoadRTPlan(DcmDataset *dataset) - { - DRTPlanIOD planObject; - OFCondition result = planObject.read(*dataset); - if(result.good()) - { - OFString tmpString, dummyString; - DRTBeamSequence &planeBeamSeqObject = planObject.getBeamSequence(); - if(planeBeamSeqObject.gotoFirstItem().good()) - { - do - { - DRTBeamSequence::Item ¤tBeamSeqItem = planeBeamSeqObject.getCurrentItem(); - if(!currentBeamSeqItem.isValid()) - { - std::cout << "Invalid Beam Sequence \n\n"; - continue; - } - BeamEntry beamEntry; - OFString beamName, beamDescription, beamType; - Sint32 beamNumber; - Float64 srcAxisDistance; - - currentBeamSeqItem.getBeamName(beamName); - currentBeamSeqItem.getBeamDescription(beamDescription); - currentBeamSeqItem.getBeamType(beamType); - currentBeamSeqItem.getBeamNumber(beamNumber); - currentBeamSeqItem.getSourceAxisDistance(srcAxisDistance); - - beamEntry.Name = beamName.c_str(); - beamEntry.Description = beamDescription.c_str(); - beamEntry.Type = beamType.c_str(); - beamEntry.Number = beamNumber; - beamEntry.SrcAxisDistance = srcAxisDistance; - - DRTControlPointSequence &controlPointSeqObject = currentBeamSeqItem.getControlPointSequence(); - if(controlPointSeqObject.gotoFirstItem().good()) - { - DRTControlPointSequence::Item &controlPointItem = controlPointSeqObject.getCurrentItem(); - if(controlPointItem.isValid()) - { - OFVector isocenterPosData_LPS; - Float64 gantryAngle, patientSupportAngle, beamLimitingDeviceAngle; - unsigned int numOfCollimatorPosItems = 0; - - controlPointItem.getIsocenterPosition(isocenterPosData_LPS); - controlPointItem.getGantryAngle(gantryAngle); - controlPointItem.getPatientSupportAngle(patientSupportAngle); - controlPointItem.getBeamLimitingDeviceAngle(beamLimitingDeviceAngle); - - beamEntry.GantryAngle = gantryAngle; - beamEntry.PatientSupportAngle = patientSupportAngle; - beamEntry.BeamLimitingDeviceAngle = beamLimitingDeviceAngle; - - DRTBeamLimitingDevicePositionSequence ¤tCollimatorPosSeqObject = controlPointItem.getBeamLimitingDevicePositionSequence(); - if(currentCollimatorPosSeqObject.gotoFirstItem().good()) - { - do - { - if(++numOfCollimatorPosItems > 2) - { - std::cout << "Number of collimator position items is higher than 2 but should be exactly 2 ..."; - return 0; - } - DRTBeamLimitingDevicePositionSequence::Item &collimatorPositionItem = currentCollimatorPosSeqObject.getCurrentItem(); - if(collimatorPositionItem.isValid()) - { - OFString beamLimitingDeviceType; - OFVector leafJawPositions; - - collimatorPositionItem.getRTBeamLimitingDeviceType(beamLimitingDeviceType); - collimatorPositionItem.getLeafJawPositions(leafJawPositions); - - if(!beamLimitingDeviceType.compare("ASYMX") || !beamLimitingDeviceType.compare("X")) - { - beamEntry.LeafJawPositions[0][0] = leafJawPositions[0]; - beamEntry.LeafJawPositions[0][1] = leafJawPositions[1]; - } - else if(!beamLimitingDeviceType.compare("ASYMY") || !beamLimitingDeviceType.compare("Y")) - { - beamEntry.LeafJawPositions[1][0] = leafJawPositions[0]; - beamEntry.LeafJawPositions[1][1] = leafJawPositions[0]; - } - else - { - std::cout << "Unknown collimator type: " << beamLimitingDeviceType << "\n\n"; - } - } - } - while(currentCollimatorPosSeqObject.gotoNextItem().good()); - } - }//endif controlPointItem.isValid() - } - this->BeamSequenceVector.push_back(beamEntry); - } - while(planeBeamSeqObject.gotoNextItem().good()); - } - } - return 1; - } - - mitk::DataNode::Pointer DicomRTReader::LoadRTDose(DcmDataset* dataset, char* filename) + mitk::DataNode::Pointer DicomRTReader:: + LoadRTDose(DcmDataset* dataset, char* filename) { std::string name = filename; itk::FilenamesContainer file; file.push_back(name); mitk::DicomSeriesReader* reader = new mitk::DicomSeriesReader; mitk::DataNode::Pointer originalNode = reader->LoadDicomSeries(file,false); - mitk::Image::Pointer originalImage = dynamic_cast(originalNode->GetData()); + mitk::Image::Pointer originalImage = + dynamic_cast(originalNode->GetData()); mitk::Geometry3D::Pointer geo = originalImage->GetGeometry()->Clone(); DRTDoseIOD doseObject; OFCondition result = doseObject.read(*dataset); if(result.bad()) { - std::cout << "Error reading the RT Dose dataset\n\n"; + MITK_ERROR << "Error reading the Dataset" << endl; return 0; } Uint16 rows, columns, frames, planarConfig, samplesPP; - OFString nrframes, doseUnits, doseType, summationType, gridScaling, photoInterpret, lutShape; + OFString nrframes, doseUnits, doseType, summationType, + gridScaling, photoInterpret, lutShape; Uint16 &rows_ref = rows; Uint16 &columns_ref = columns; Float32 gridscale; -// const Uint16 *pixelData = NULL; const Uint16 *pixelData = NULL; unsigned long count = 0; doseObject.getRows(rows_ref); doseObject.getColumns(columns_ref); doseObject.getNumberOfFrames(nrframes); doseObject.getDoseUnits(doseUnits); doseObject.getDoseType(doseType); doseObject.getDoseSummationType(summationType); doseObject.getDoseGridScaling(gridScaling); doseObject.getPhotometricInterpretation(photoInterpret); doseObject.getPlanarConfiguration(planarConfig); doseObject.getSamplesPerPixel(samplesPP); doseObject.getPresentationLUTShape(lutShape); - //standard testing picture: 0.001 - gridscale = OFStandard::atof(gridScaling.c_str()); - std::cout << std::setprecision(10) << "GRIDSCALE >> " << gridscale << endl; - frames = atoi(nrframes.c_str()); + gridscale = static_cast(*gridScaling.c_str()); + frames = static_cast(*nrframes.c_str()); - //dataset->findAndGetUint16Array(DCM_PixelData, pixelData, &count); dataset->findAndGetUint16Array(DCM_PixelData, pixelData, &count); mitk::Image::Pointer image = mitk::Image::New(); mitk::PixelType pt = mitk::MakeScalarPixelType(); unsigned int dim[] = {columns,rows,frames}; image->Initialize( pt, 3, dim); image->SetSpacing(1.0); mitk::Point3D m_origin; m_origin[0] = 0.0; m_origin[1] = 0.0; m_origin[2] = 0.0; image->SetOrigin(m_origin); + //HELP CAST UND DEPRECATED float* pixel = (float*)image->GetData(); int size = dim[0]*dim[1]*dim[2]; for(int i=0; iSetGeometry(geo); double prescripeDose = this->GetMaxDoseValue(dataset); mitk::DataNode::Pointer node = mitk::DataNode::New(); node->SetName("DicomRT Dosis"); -// node->SetProperty("shader.mitkIsoLineShader.Gridscale", mitk::FloatProperty::New(10.0)); - node->SetFloatProperty(mitk::rt::Constants::PRESCRIBED_DOSE_PROPERTY_NAME.c_str(),prescripeDose); + node->SetFloatProperty(mitk::rt::Constants:: + PRESCRIBED_DOSE_PROPERTY_NAME.c_str(),prescripeDose); + node->SetFloatProperty(mitk::rt::Constants:: + REFERENCE_DOSE_PROPERTY_NAME.c_str(), 40); node->SetBoolProperty(mitk::rt::Constants::DOSE_PROPERTY_NAME.c_str(),true); - node->SetFloatProperty(mitk::rt::Constants::REFERENCE_DOSE_PROPERTY_NAME.c_str(), 40); -// node->SetProperty("Image Rendering.Transfer Function", mitkTransFuncProp); -// node->SetProperty("Image Rendering.Mode", renderingMode); -// node->SetProperty("opacity", mitk::FloatProperty::New(0.3)); node->SetData(image); - MITK_INFO << "PRESCRIPEDOSE >> " << prescripeDose << endl; - return node; } double DicomRTReader::GetMaxDoseValue(DcmDataset* dataSet) { DRTDoseIOD doseObject; OFCondition result = doseObject.read(*dataSet); if(result.bad()) { std::cout << "Error reading the RT Dose dataset\n\n"; return 0; } Uint16 rows, columns, frames; OFString nrframes, gridScaling; const Uint16 *pixelData = NULL; Float32 gridscale; Uint16 &rows_ref = rows; Uint16 &columns_ref = columns; doseObject.getRows(rows_ref); doseObject.getColumns(columns_ref); doseObject.getNumberOfFrames(nrframes); doseObject.getDoseGridScaling(gridScaling); frames = atoi(nrframes.c_str()); gridscale = OFStandard::atof(gridScaling.c_str()); MITK_INFO << "Gridscale " << gridscale << endl; MITK_INFO << "As String: " << gridScaling << endl; dataSet->findAndGetUint16Array(DCM_PixelData, pixelData, 0); int size = columns*rows*frames; double highest = 0; for(int i=0; ihighest) { highest = pixelData[i] * gridscale; } } return highest; } } diff --git a/Modules/DicomRT/mitkDicomRTReader.h b/Modules/DicomRT/mitkDicomRTReader.h index 5212787338..576b1c54d1 100644 --- a/Modules/DicomRT/mitkDicomRTReader.h +++ b/Modules/DicomRT/mitkDicomRTReader.h @@ -1,232 +1,196 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkDicomRTReader_h #define mitkDicomRTReader_h #include #include #include #include #include "mitkContourModel.h" -#include "mitkContourElement.h" #include -#include "dcmtk/config/osconfig.h" -#include "dcmtk/ofstd/ofconapp.h" - -#include "dcmtk/ofstd/ofcond.h" - +#include "dcmtk/dcmrt/drtstrct.h" #include "dcmtk/dcmrt/drtdose.h" #include "dcmtk/dcmrt/drtimage.h" -#include "dcmtk/dcmrt/drtplan.h" -#include "dcmtk/dcmrt/drttreat.h" -#include "dcmtk/dcmrt/drtionpl.h" -#include "dcmtk/dcmrt/drtiontr.h" - -#include -#include -#include -#include + #include -#include -#include #include #include #include -#include -#include - -#include "dcmtk/dcmrt/drtstrct.h" - -#include -#include -#include -#include -#include -#include -#include -#include - class vtkPolyData; class DcmDataset; class OFString; class DRTContourSequence; class DRTStructureSetIOD; namespace mitk { class MitkDicomRT_EXPORT DicomRTReader: public itk::Object { typedef std::deque ContourModelSetVector; /** * @brief Describes and holds some information about the beams. */ class BeamEntry { public: BeamEntry() { Number=-1; SrcAxisDistance=0.0; GantryAngle=0.0; PatientSupportAngle=0.0; BeamLimitingDeviceAngle=0.0; LeafJawPositions[0][0]=0.0; LeafJawPositions[0][1]=0.0; LeafJawPositions[1][0]=0.0; LeafJawPositions[1][1]=0.0; } unsigned int Number; std::string Name; std::string Type; std::string Description; double SrcAxisDistance; double GantryAngle; double PatientSupportAngle; double BeamLimitingDeviceAngle; double LeafJawPositions[2][2]; }; /** * @brief Describes and holds some information about the Rois. */ class RoiEntry { public: RoiEntry(); virtual ~RoiEntry(); RoiEntry(const RoiEntry& src); RoiEntry &operator=(const RoiEntry &src); void SetPolyData(ContourModelSet::Pointer roiPolyData); unsigned int Number; std::string Name; std::string Description; double DisplayColor[3]; mitk::ContourModelSet::Pointer ContourModelSet; }; public: mitkClassMacro( DicomRTReader, itk::Object ); itkNewMacro( Self ); /** * @brief Get the maximum dose value from the dose file * @param dataSet The DcmDataset of the DicomRTDose file * @return The dose value * * Checks all pixel values for the maximum value */ double GetMaxDoseValue(DcmDataset* dataSet); /** * @brief Used for reading a DicomRT file * @param filename The path with your file which you want to read * * Calls the right method for reading a dose, structure or plan file. */ ContourModelSetVector ReadDicomFile(char* filename); /** * @brief Reads a DcmDataset from a DicomRT structureset file * @param dataset DcmDataset-object from DCMTK * @return Returns a Deque with mitk::ContourModelSet * - * The returned mitk::ContourModelSet represent exactly one Roi/Structureset. + * The returned mitk::ContourModelSet represent exactly one + * Roi/Structureset. * So the size of the returned deque is the number of Rois. The names of the * rois is stored in their mitk::Property. */ ContourModelSetVector ReadStructureSet(DcmDataset* dataset); - /** - * @brief Reads a DcmDataset from a DicomRT plan file - * @param dataset DcmDataset-object from DCMTK - * @return The return doesnt make senese at the moment - * - * This method isnt ready for use at the moment. Dont use it! - */ - int LoadRTPlan(DcmDataset* dataset); - /** * @brief Reads a DcmDataset from a DicomRT dose file * @param dataset DcmDataset-object from DCMTK * @param filename The path with the dose file used for getting the geometry - * @return Returns a mitk::DataNode::Pointer in which a mitk::Image is stored + * @return Returns a mitkDataNode::Pointer in which a mitk::Image is stored * - * The method reads the PixelData from the DicomRT dose file and scales them - * with a factor for getting Gray-values instead of pixel-values. - * The Gray-values are stored in a mitk::Image with an vtkColorTransferFunction. + * The method reads the PixelData from the DicomRT dose file and scales + * them with a factor for getting Gray-values instead of pixel-values. + * The Gray-values are stored in a mitkImage with a vtkColorTransferFunc. * Relative values are used for coloring the image. The relative values are * relative to a PrescriptionDose definied in the RT-Plan. If there is no * RT-Plan file PrescriptionDose is set to 80% of the maximum dose. */ mitk::DataNode::Pointer LoadRTDose(DcmDataset* dataset, char* filename); /** * @brief Returns the number of Rois stored in the RoiSequenceVector * @return unsigned long size_t Number of Rois */ size_t GetNumberOfRois(); /** * @brief Find a Roi stored in the RoiSequenceVector by his number * @param roiNumber The number of the searched roi * @return Returns a mitk::DicomRTReader::RoiEntry object */ - RoiEntry* FindRoiByNumber(unsigned int roiNumber); + RoiEntry* FindRoiByNumber(unsigned int roiNum); /** * @brief GetReferencedFrameOfReferenceSOPInstanceUID * @param structSetObject * @return */ - OFString GetReferencedFrameOfReferenceSOPInstanceUID(DRTStructureSetIOD &structSetObject); + OFString GetRefFrameOfRefSOPInstanceUID + (DRTStructureSetIOD &structSetObject); /** * Virtual destructor. */ virtual ~DicomRTReader(); protected: /** * @brief Storing the Rois found in the Structureset file */ std::vector RoiSequenceVector; /** * @brief Storing the Beams foud in the RT Plan file */ std::vector BeamSequenceVector; /** * Constructor. */ DicomRTReader(); }; } #endif