Hi
I try with the segmentation export to file function. It does not work for the line “import DICOMScalarVolumePlugin”,
https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#export-a-volume-to-dicom-file-format
in the python console in 3d slicer, the error is like
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘DICOMSegmentationPlugin’ is not defined
Does this package still work. How can I install this ?
the code snippet is as follow:
Export a volume to DICOM file format¶
volumeNode = getNode(“CTChest”) outputFolder = “c:/tmp/dicom-output” # Create patient and study and put the volume under the study shNode = slicer.vtkMRMLSubjectHierarchyNode.GetSubjectHierarchyNode(slicer.mrmlScene) # set IDs. Note: these IDs are not specifying DICOM tags, but only the names that appear in the hierarchy tree patientItemID = shNode.CreateSubjectItem(shNode.GetSceneItemID(), “test patient”) studyItemID = shNode.CreateStudyItem(patientItemID, “test study”) volumeShItemID = shNode.GetItemByDataNode(volumeNode) shNode.SetItemParent(volumeShItemID, studyItemID) import DICOMScalarVolumePlugin exporter = DICOMScalarVolumePlugin.DICOMScalarVolumePluginClass() exportables = exporter.examineForExport(volumeShItemID) for exp in exportables: # set output folder exp.directory = outputFolder # here we set DICOM PatientID and StudyID tags exp.setTag(‘PatientID’, “test patient”) exp.setTag(‘StudyID’, “test study”) exporter.export(exportables)