MetaImage has been in use for several years by a wide range of research at UNC, Chapel Hill. The central code of MetaImage/MetaIO is quite stable. We have now extended that file format to support a variety of objects that occur in medicine such a tubes (for vessels, needles, etc.), blobs (for arbitrary shaped objects), cubes, spheres, etc. MetaImage is the text-based tagged file format for medical images that resulted. 2.3.4 Reading DICOM and Other One-Slice-Per-File Data Formats.2.3.3 Reading a Brick-of-Bytes (an N-Dimensional volume in a single file).However if I try to do that he always tells me that there is no such method for the 'ImageSeriesReaderClass' even though it is mentioned in the documentation. # We explicitly configure the reader to load tags, including theĮDIT: It seems that i also need to run the '.MetaDataDictionaryArrayUpdateOn()' module on my reader. # By default if tags are loaded, the private tags are not loaded. # By default tags are not loaded (saves time). # Configure the reader to load all of the DICOM tags (publicprivate): Series_reader.SetFileNames(series_file_names) Series_file_names = (data_directory, series_IDs) Print("ERROR: given directory \"" data_directory "\" does not contain a DICOM series.") First obtain the series file names using the Writer.SetFileName(os.path.join(directory,str(i) '.dcm')) # Write to the output directory and add the extension dcm, to force writing in DICOM format. Image_slice.SetMetaData("0020,0013", str(i)) # Instance Number Image_slice.SetMetaData("0020|0032", '\\'.join(map(str,new_img.TransformIndexToPhysicalPoint((0,0,i))))) # Image Position (Patient) Image_slice.SetMetaData("0008|0060", "CT") # set the type to CT so the thickness is carried over Image_slice.SetMetaData("0008|0013", time.strftime("%H%M%S")) # Instance Creation Time Image_slice.SetMetaData("0008|0012", time.strftime("%Y%m%d")) # Instance Creation Date ("0020|0037", '\\'.join(map(str, (direction, direction, direction,# Image Orientation (Patient)ĭirection,direction,direction)))), # with zero, and separated by a '.' We create a unique series ID using the date and time. # For the series instance UID (0020|000e), each of the components is a number, cannot start # Copy some of the tags and add the relevant tags indicating the change. Modification_date = time.strftime("%Y%m%d") Modification_time = time.strftime("%H%M%S") "0020|0010", # Study ID, for human consumption "0020|000D", # Study Instance UID, for machine consumption # Copy relevant tags from the original meta-data dictionary (private tags are also # dictionary and not the automatically generated information from the file IO # Use the study/series/frame of reference information given in the meta-data # list of tags that need to be modified see: This is a delicate opration and requires knowlege of # IMPORTANT: There are many DICOM tags that need to be updated when you modify an New_img = sitk.GetImageFromArray(new_arr)ĭirectory = r"C:\Users\jeroen\Documents\2eMaster\Reconstruction3D\Projet Femur\Dicom\test" # See the License for the specific language governing permissions and # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # distributed under the License is distributed on an "AS IS" BASIS, # Unless required by applicable law or agreed to in writing, software # You may obtain a copy of the License at # you may not use this file except in compliance with the License. # Licensed under the Apache License, Version 2.0 (the "License")
0 Comments
Leave a Reply. |