ai_ct_scans.data_writing module
- ai_ct_scans.data_writing.create_dicom_file(file_path, pixel_array, slice_location=1000.0)
Save a pixel array to a dicom file.
- Parameters
file_path (str) – path to where you want to save the dicom file
pixel_array (np.ndarray, uint16) – The 2D data you wish to save in a dicom file
slice_location (float) – An absolute axial position for the slice
- Returns
pydicom.dataset with pixel_array accessible
- Return type
(pydicom.dataset)
- ai_ct_scans.data_writing.ndarray_to_memmap(arr, directory, prefix)
Writes an ndarray to hard drive with a generated name that stores shape information to allow reloading :param arr: ndarray to be saved :type arr: ndarray :param directory: pathlib Path to a directory :type directory: pathlib Path :param prefix: a filename, without file extensions :type prefix: str
- Returns
the path to the saved memmap
- Return type
(pathlib Path)