This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INCLUDE_DIRECTORIES( | |
#DCMTK | |
C:/pro/dcmtk/build/include | |
C:/pro/dcmtk/src/dcmdata/include/dcmtk/dcmdata | |
C:/pro/dcmtk/build/include | |
C:/pro/dcmtk/src/dcmdata/include | |
C:/pro/dcmtk/src/ofstd/include | |
C:/pro/dcmtk/src/oflog/include | |
C:/pro/dcmtk/src/dcmimage/include/dcmtk | |
C:/pro/dcmtk/src/dcmimgle/include |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Includes DCMTK | |
#include "dcdicdir.h" | |
#include "dcdeftag.h" | |
#include "dcddirif.h" | |
#include "dcmtk/config/osconfig.h" | |
#include "dctk.h" | |
#include "dcmimage.h" | |
#include "diregist.h" // Support for color images | |
#include "dcrledrg.h" // Support for RLE images | |
#include "djdecode.h" // Support for JPEG images |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//hierarchyRecord being a DcmDirectoryRecord (check DICOMDIR_Open.cpp) | |
OFCondition status = EC_TagNotFound; | |
DcmStack stack; | |
DcmObject *object = NULL; | |
//Browse the properties of the element | |
while (hierarchyRecord->nextObject(stack, OFTrue).good()) | |
{ | |
object = stack.top(); | |
DcmTag tag = object->getTag(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Open the DICOM file and get the dictionary | |
DcmFileFormat fileformat; | |
OFCondition status = fileformat.loadFile(file); | |
DcmDataset *dictionary; | |
if (status.good()) | |
dictionary = fileformat.getDataset(); | |
///////////////////////////////////////// | |
// Modify anything in the DICOM file // | |
///////////////////////////////////////// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Functions to copy a pixel | |
void Anonymizer::copyPixel(const Uint8* src, Uint8* dest, int at, int SamplesPerPixel) | |
{ | |
for(int spp=0; spp<SamplesPerPixel; spp++) | |
dest[at+spp] = src[at+spp]; | |
} | |
void Anonymizer::copyPixel(const Uint16* src, Uint16* dest, int at, int SamplesPerPixel) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char *file = "C:/Folder1/Folder2/dicomfile"; | |
//Open the DICOM file and get the dictionary | |
DcmFileFormat fileformat; | |
OFCondition status = fileformat.loadFile(file); | |
DcmDataset *dictionary; | |
if (status.good()) | |
dictionary = fileformat.getDataset(); | |
//Get the transfer syntax to check if we need jpeg codecs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char *file = "C:/Folder1/Folder2/dicomfile"; | |
//Open the DICOM file and get the dictionary | |
DcmFileFormat fileformat; | |
OFCondition status = fileformat.loadFile(file); | |
DcmDataset *dictionary; | |
if (status.good()) | |
dictionary = fileformat.getDataset(); | |
//Get the transfer syntax to check if we need jpeg codecs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char *file = "C:/Folder1/Folder2/dicomfile"; | |
//Open the DICOM file | |
DcmFileFormat fileformat; | |
OFCondition status = fileformat.loadFile(file); | |
DcmDataset *dictionary; | |
//If the loading worked | |
if( status.good() ) | |
dictionary = fileformat.getDataset(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Open the DICOMDIR File | |
QString DICOMDIR_folder = "C:/Folder1/Folder2"; | |
const char *fileName = "C:/Folder1/Folder2/DICOMDIR"; | |
DcmDicomDir dicomdir(fileName); | |
//Retrieve root node | |
DcmDirectoryRecord *root = &dicomdir.getRootRecord(); | |
//Prepare child elements | |
DcmDirectoryRecord *rootTest = new DcmDirectoryRecord(*root); | |
DcmDirectoryRecord *PatientRecord = NULL; | |
DcmDirectoryRecord *StudyRecord = NULL; |