To load dicom series “.dcm” file, code is as below
qSlicerCoreIOManager* ioManager = qSlicerCoreApplication::application()->coreIOManager();
properties["fileName"] = file; // the first file in series
ioManager->loadNodes("VolumeFile", properties );
some dicom files can be loaded as single volume, some generates multiple series for every dicom file
Specifying VolumeFile would use ITK library’s DICOM reader, which only loads some images correctly. It loads some images incorrectly or not at all, and it cannot read any other information objects. Therefore, I would recommend to always use the DICOM module for loading DICOM data. First you need to import the data, then examine, select what you want to load, and finally load them. You can find examples in the script repository. You can execute Python commands in C++ using the Python manager object.