Skip to content

Instantly share code, notes, and snippets.

@michaelrossherron
Last active September 6, 2023 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelrossherron/1d0256baf8f38e44af01185477d6e16b to your computer and use it in GitHub Desktop.
Save michaelrossherron/1d0256baf8f38e44af01185477d6e16b to your computer and use it in GitHub Desktop.
16-bit DICOM incorrectly identified as 32-bit
cmake_minimum_required(VERSION 3.1.0)
project(SITKTests)
find_package(SimpleITK QUIET)
add_executable(pixelTypeTest pixelTypeTest.cpp)
target_link_libraries(pixelTypeTest ${SimpleITK_LIBRARIES})
#include <SimpleITK.h>
#include <iostream>
namespace sitk = itk::simple;
// usage: pixelTypeTest [/directory/containing/dicom/images/]
int main ( int argc, char* argv[] )
{
sitk::ImageSeriesReader reader;
reader.SetFileNames(sitk::ImageSeriesReader::GetGDCMSeriesFileNames(argv[1]));
sitk::Image image = reader.Execute();
std::cout << image.GetPixelID() << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment