Hi @thewtex ,
We are trying to add the ITK writer in project MONAI, I searched the doc of ITK but I didn't find how to save a nifti or dicom image with provided numpy array and affine matrix. Could you please help show some example?
Expected code:
def save(np_array: np.ndarray, affine_matrix: np.ndarray):
itk_np_view = itk.image_view_from_array(np_array)
itk_np_view.SetMatrix(affine_matrix)
itk.imwrite(itk_np_view, filename)
But seems there is no SetMatrix API.
Thanks in advance.