InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.43k stars 665 forks source link

Dicom reading #3202

Closed Eric-JH closed 2 years ago

Eric-JH commented 2 years ago

Description

I tried my code and the error was reported. I couldn't unstander the error info.

code

`

include "itkImageFileReader.h"

include "itkImageFileWriter.h"

include "itkRescaleIntensityImageFilter.h"

include "itkGDCMImageIO.h"

include "itkJPEGImageIOFactory.h"

int main(int argc, char* argv[]) {

using InputPixelType = signed short;
const unsigned int InputDimension = 2;
using InputImageType = itk::Image<InputPixelType, InputDimension>;
using ReaderType = itk::ImageFileReader<InputImageType>;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName("C:\\Users\\26327\\Desktop\\dll4sw\\data\\SE3\\IM100.dcm");
using ImageIOType = itk::GDCMImageIO;
ImageIOType::Pointer gdcmImageIO = ImageIOType::New();
reader->SetImageIO(gdcmImageIO);
try
{
    reader->Update();
}
catch (itk::ExceptionObject& e)
{
    std::cerr << "exception in file reader" << std::endl;
    std::cerr << e << std::endl;
    return EXIT_FAILURE;
}
return EXIT_SUCCESS;

} `

Environment

windows 10 MSVC2022

Error info

Warning: In D:\vcpkg\buildtrees\gdcm\src\8c1c28481dfbbf6b12dd.clean\Source\MediaStorageAndFileFormat\gdcmDataSetHelper.cxx, line 107, function gdcm::DataSetHelper::ComputeVR Please report. Missing dict entry for: [ELSCINT1] de is: (07a1,10a7) SH 4 Loaded:4

dzenanz commented 2 years ago

Maybe all that is needed is updated GDCM (#3042). Could you try building against that branch?

dzenanz commented 2 years ago

The error message says that the DICOM dictionary which comes with GDCM does not contain something used in the image you are trying to read. The expectation is that a newer version of GDCM might have it. Otherwise report it to the maintainer, @malaterre. CC: @seanm.

issakomi commented 2 years ago

There is no entry for that private tag in GDCM master. This warning should not prevent image from loading. If the file fails to load it may have private transfer syntax and _PMSCTRLE1 or LOSSLESS RICE compression. To identify it you could post dump (gdcmdump or dcmdump), sensitive attributes like names, maybe SOP Instance UID, study and series UIDs, etc. can be deleted. For _PMSCTRLE1 there is the example rle2img.cxx in GDCM Examples folder.

el

malaterre commented 2 years ago

@Eric-JH As pointed out by @issakomi there is no relation in between the warning reported and your description of an "error". Please either submit the original DICOM dataset, or provide a clearer error description. I am going to incorporate the new dict entry so that the warning disapear in next release of gdcm.

Closing as incomplete, feel free to re-open.

malaterre commented 2 years ago

For reference: 450b3d342a5866ff13275801686c18386d083de5

Eric-JH commented 2 years ago

@malaterre How can I send the dicom file to you

malaterre commented 2 years ago

@Eric-JH Just use the email: git log | grep malaterre. As mentionned on the gdcm-developers mailing list, you can use gdcmanon to remove any PHI.