ImageSeriesReader_GetGDCMSeriesFileNames ( data_directory, series ) interact ( DICOM_series_dropdown_callback, series_to_load = list ( series_IDs ), series_dictionary = fixed ( series_file_names )) else : print ( 'Data directory does not contain any DICOM series.' ) ImageSeriesReader_GetGDCMSeriesIDs ( data_directory ) # Check that we have at least one series if series_IDs : for series in series_IDs : series_file_names = sitk. ReadImageInformation () tags_to_print = series_IDs = sitk. SetFileName ( series_dictionary ) file_reader. ImageFileReader () def DICOM_series_dropdown_callback ( series_to_load, series_dictionary ): global selected_series # Print some information about the series from the meta-data dictionary # DICOM standard part 6, Data Dictionary: file_reader. dirname ( fdata ( "CIRS057A_MR_CT_DICOM/readme.txt" )) # Global variable 'selected_series' is updated by the interact function selected_series = '' file_reader = sitk. We start with reading and writing an image using the procedural interface.ĭata_directory = os. The meta-data dictionary for each file is available using the HasMetaDataKey and GetMetaData methods. On the other hand, if you use the object oriented interface, the set of dictionaries will be accessible from the ImageSeriesReader which you used to read the DICOM series. To obtain each dictionary you will have to access each of the files separately. If you use the procedural method for reading the series then you do not have access to the set of meta-data dictionaries associated with each of the files. When a DICOM image series is read as a single image volume, the resulting image's meta-data dictionary is not populated since DICOM tags are specific to each of the files in the series. Images stored in the DICOM format have a meta-data dictionary associated with them, which is populated with the DICOM tags. We look at DICOM images as an example illustrating this difference. The primary difference being that the object oriented approach provides more control while the procedural interface is more convenient. The toolkit provides both an object oriented and a procedural interface. SimpleITK can read and write images stored in a single file, or a set of files (e.g. To address this issue you can either specify the appropriate pixel type when reading or creating the image, or use the Cast function. The primary example is the registration framework which works with sitkFloat32 or sitkFloat64. Some filters only work with images with a specific pixel type. There is also sitkUnknown, which is used for undefined or erroneous pixel ID's. Multi-component of unsigned 64 bit integer Multi-component of unsigned 32 bit integer Multi-component of unsigned 16 bit integer Multi-component of unsigned 8 bit integer The following is a table of the enumerated list. The pixel type is represented as an enumerated type.
0 Comments
Leave a Reply. |