Rename vtkDICOMImageReader2 to vtkDCMTKImageReader.
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
#include "Common/SeriesImageSet.h"
|
#include "Common/SeriesImageSet.h"
|
||||||
#include "DICOMHeaderHelper.h"
|
#include "DICOMHeaderHelper.h"
|
||||||
#include "ExtendMedicalImageProperties.h"
|
#include "ExtendMedicalImageProperties.h"
|
||||||
#include "vtkDICOMImageReader2.h"
|
#include "vtkDCMTKImageReader.h"
|
||||||
#include "vtkImageData.h"
|
#include "vtkImageData.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@@ -125,7 +125,7 @@ SeriesImageSet* DicomLoader::getSeriesImageSet(const std::string& uniqueID)//, D
|
|||||||
return store[uniqueID];
|
return store[uniqueID];
|
||||||
}
|
}
|
||||||
if (reader) reader->Delete();
|
if (reader) reader->Delete();
|
||||||
reader = vtkDICOMImageReader2::New();
|
reader = vtkDCMTKImageReader::New();
|
||||||
auto iter = std::find_if(imageProperties.begin(), imageProperties.end(),[&uniqueID](auto property){
|
auto iter = std::find_if(imageProperties.begin(), imageProperties.end(),[&uniqueID](auto property){
|
||||||
return property->GetUniqueID()==uniqueID;
|
return property->GetUniqueID()==uniqueID;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class SeriesImageSet;
|
|||||||
|
|
||||||
class DICOMHeaderHelper;
|
class DICOMHeaderHelper;
|
||||||
class ExtendMedicalImageProperties;
|
class ExtendMedicalImageProperties;
|
||||||
class vtkDICOMImageReader2;
|
class vtkDCMTKImageReader;
|
||||||
typedef std::map<std::string, SeriesImageSet*> ImageSetStore;
|
typedef std::map<std::string, SeriesImageSet*> ImageSetStore;
|
||||||
|
|
||||||
class DicomLoader {
|
class DicomLoader {
|
||||||
@@ -67,7 +67,7 @@ private:
|
|||||||
|
|
||||||
ExtendMedicalImageProperties * currentImageProperty = nullptr;
|
ExtendMedicalImageProperties * currentImageProperty = nullptr;
|
||||||
std::vector<ExtendMedicalImageProperties*> imageProperties;
|
std::vector<ExtendMedicalImageProperties*> imageProperties;
|
||||||
vtkDICOMImageReader2 * reader = nullptr;
|
vtkDCMTKImageReader * reader = nullptr;
|
||||||
ImageSetStore store;
|
ImageSetStore store;
|
||||||
std::string defaultUniqueID;
|
std::string defaultUniqueID;
|
||||||
PatientsMapType m_patients;
|
PatientsMapType m_patients;
|
||||||
|
|||||||
@@ -2,27 +2,29 @@
|
|||||||
// Created by Krad on 2022/2/8.
|
// Created by Krad on 2022/2/8.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <vtkErrorCode.h>
|
#include "vtkDCMTKImageReader.h"
|
||||||
#include "vtkDICOMImageReader2.h"
|
|
||||||
#include "vtkDataArray.h"
|
|
||||||
#include "vtkImageData.h"
|
|
||||||
#include "vtkObjectFactory.h"
|
|
||||||
#include "vtkPointData.h"
|
|
||||||
|
|
||||||
|
#include <vtkErrorCode.h>
|
||||||
|
#include <vtkDataArray.h>
|
||||||
|
#include <vtkImageData.h>
|
||||||
|
#include <vtkObjectFactory.h>
|
||||||
|
#include <vtkPointData.h>
|
||||||
|
|
||||||
|
#include "ExtendMedicalImageProperties.h"
|
||||||
#include "IO/DICOM/DICOMPixelDataHelper.h"
|
#include "IO/DICOM/DICOMPixelDataHelper.h"
|
||||||
|
|
||||||
vtkStandardNewMacro(vtkDICOMImageReader2);
|
vtkStandardNewMacro(vtkDCMTKImageReader);
|
||||||
|
|
||||||
vtkDICOMImageReader2::vtkDICOMImageReader2():vtkDICOMImageReader() {
|
vtkDCMTKImageReader::vtkDCMTKImageReader(): vtkImageReader2() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vtkDICOMImageReader2::~vtkDICOMImageReader2() {
|
vtkDCMTKImageReader::~vtkDCMTKImageReader() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void vtkDICOMImageReader2::SetupOutputInformation(int num_slices)
|
void vtkDCMTKImageReader::SetupOutputInformation(int num_slices)
|
||||||
{
|
{
|
||||||
|
|
||||||
int width = this->properties->GetColumns();
|
int width = this->properties->GetColumns();
|
||||||
@@ -66,7 +68,7 @@ void vtkDICOMImageReader2::SetupOutputInformation(int num_slices)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void vtkDICOMImageReader2::ExecuteInformation() {
|
void vtkDCMTKImageReader::ExecuteInformation() {
|
||||||
if (!properties)
|
if (!properties)
|
||||||
{
|
{
|
||||||
vtkErrorMacro( << "No image properties set for the reader.");
|
vtkErrorMacro( << "No image properties set for the reader.");
|
||||||
@@ -76,7 +78,7 @@ void vtkDICOMImageReader2::ExecuteInformation() {
|
|||||||
this->SetupOutputInformation(static_cast<int>(properties->GetFileNames().size()));
|
this->SetupOutputInformation(static_cast<int>(properties->GetFileNames().size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void vtkDICOMImageReader2::ExecuteDataWithInformation(vtkDataObject *output,
|
void vtkDCMTKImageReader::ExecuteDataWithInformation(vtkDataObject *output,
|
||||||
vtkInformation *outInfo) {
|
vtkInformation *outInfo) {
|
||||||
vtkImageData *data = this->AllocateOutputData(output, outInfo);
|
vtkImageData *data = this->AllocateOutputData(output, outInfo);
|
||||||
if (!properties) {
|
if (!properties) {
|
||||||
@@ -152,28 +154,11 @@ void vtkDICOMImageReader2::ExecuteDataWithInformation(vtkDataObject *output,
|
|||||||
DICOMPixelDataHelper::FinalizeCodecs();
|
DICOMPixelDataHelper::FinalizeCodecs();
|
||||||
}
|
}
|
||||||
|
|
||||||
double* vtkDICOMImageReader2::GetPixelSpacing()
|
double* vtkDCMTKImageReader::GetPixelSpacing()
|
||||||
{
|
{
|
||||||
return this->properties->GetSpacing();
|
return this->properties->GetSpacing();
|
||||||
}
|
}
|
||||||
|
|
||||||
void vtkDICOMImageReader2::SetFileNames(const std::vector<std::string>& files) {
|
vtkImageData *vtkDCMTKImageReader::GetOutputOverLayData() {
|
||||||
|
|
||||||
this->DICOMFileNames->clear();
|
|
||||||
for (vtkIdType i = 0; i < files.size(); i++)
|
|
||||||
{
|
|
||||||
if (strcmp(files[i].c_str(), ".") == 0 ||
|
|
||||||
strcmp(files[i].c_str(), "..") == 0)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string fileString = files[i];
|
|
||||||
vtkDebugMacro( << "Adding " << fileString.c_str() << " to DICOMFileNames.");
|
|
||||||
this->DICOMFileNames->push_back(fileString);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
vtkImageData *vtkDICOMImageReader2::GetOutputOverLayData() {
|
|
||||||
return OverLayData;
|
return OverLayData;
|
||||||
}
|
}
|
||||||
@@ -6,33 +6,26 @@
|
|||||||
#define DCMV_VTKDICOMIMAGEREADER2_H
|
#define DCMV_VTKDICOMIMAGEREADER2_H
|
||||||
|
|
||||||
|
|
||||||
#include <vtkDICOMImageReader.h>
|
#include <vtkImageReader2.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "ExtendMedicalImageProperties.h"
|
class ExtendMedicalImageProperties;
|
||||||
class vtkDICOMImageReaderVector : public std::vector<std::string>
|
|
||||||
{
|
|
||||||
|
|
||||||
};
|
class vtkDCMTKImageReader: public vtkImageReader2 {
|
||||||
class vtkDICOMImageReader2: public vtkDICOMImageReader {
|
|
||||||
public:
|
public:
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
* Static method for construction.
|
* Static method for construction.
|
||||||
*/
|
*/
|
||||||
static vtkDICOMImageReader2 *New();
|
static vtkDCMTKImageReader *New();
|
||||||
vtkTypeMacro(vtkDICOMImageReader2,vtkDICOMImageReader);
|
vtkTypeMacro(vtkDCMTKImageReader, vtkImageReader2);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
|
||||||
void SetFileNames(const std::vector<std::string>& files);
|
|
||||||
void SetImageProperties(ExtendMedicalImageProperties* p){
|
void SetImageProperties(ExtendMedicalImageProperties* p){
|
||||||
this->properties = p;
|
this->properties = p;
|
||||||
}
|
}
|
||||||
vtkDICOMImageReaderVector* GetDICOMFileNames(){
|
|
||||||
return DICOMFileNames;
|
|
||||||
}
|
|
||||||
double* GetPixelSpacing();
|
double* GetPixelSpacing();
|
||||||
|
|
||||||
vtkGetMacro(HasOverlay, bool);
|
vtkGetMacro(HasOverlay, bool);
|
||||||
@@ -44,21 +37,20 @@ protected:
|
|||||||
|
|
||||||
void SetupOutputInformation(int num_slices);
|
void SetupOutputInformation(int num_slices);
|
||||||
void ExecuteInformation() override;
|
void ExecuteInformation() override;
|
||||||
void ExecuteDataWithInformation(vtkDataObject *output,
|
void ExecuteDataWithInformation(vtkDataObject *output,vtkInformation *outInfo) override ;
|
||||||
vtkInformation *outInfo) override ;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Constructor
|
// Constructor
|
||||||
//
|
//
|
||||||
vtkDICOMImageReader2();
|
vtkDCMTKImageReader();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Destructor
|
// Destructor
|
||||||
//
|
//
|
||||||
~vtkDICOMImageReader2() override;
|
~vtkDCMTKImageReader() override;
|
||||||
private:
|
private:
|
||||||
vtkDICOMImageReader2(const vtkDICOMImageReader2&) = delete;
|
vtkDCMTKImageReader(const vtkDCMTKImageReader&) = delete;
|
||||||
void operator=(const vtkDICOMImageReader2&) = delete;
|
void operator=(const vtkDCMTKImageReader&) = delete;
|
||||||
ExtendMedicalImageProperties* properties = nullptr;
|
ExtendMedicalImageProperties* properties = nullptr;
|
||||||
vtkImageData* OverLayData = nullptr;
|
vtkImageData* OverLayData = nullptr;
|
||||||
bool HasOverlay = false;
|
bool HasOverlay = false;
|
||||||
Reference in New Issue
Block a user