Example #1
0
File: main.py Project: yf817/MPhys
def read_dicom(dicom_path):
    # Function that reads a dicom file and writes to a text file
    dataset = ReadData.read_dicom(dicom_path)
    # vector_grid = dataset.DeformableRegistrationSequence[1].DeformableRegistrationGridSequence[0].VectorGridData
    # vector_grid = np.array(vector_grid).astype(np.float64)
    #
    # with open("dvf.raw", "wb") as f:
    #     f.write(vector_grid)
    ReadData.write_dicom(dataset, "image_test")
Example #2
0
def read_dicom(dicom_path):
    # Function that reads a dicom file and writes to a text file
    dataset = ReadData.read_dicom(dicom_path)
    ds = dataset.DeformableRegistrationSequence[
        1].DeformableRegistrationGridSequence[0].VectorGridData
    ds = np.array(ds).astype(np.float64)
    print(ds)
    with open("dvf.raw", "wb") as f:
        f.write(ds)
    ReadData.write_dicom(dataset, "dvf")
Example #3
0
def read_dicom(dicom_path):
    ds = ReadData.read_dicom(dicom_path)
    #petct_data =
    # dvf_data = ReadData.load_dvf_data(ds)
    ReadData.write_dicom(ds, "pct_dicom")