Skip to content

Commit

Permalink
ENH: Use manually crafted atlas meshes
Browse files Browse the repository at this point in the history
Applying RAS to LPS transform to
atlas_FC_inner_mesh_world.ply
atlas_TC_inner_mesh_world.ply
makes them properly aligned with the atlas image.
  • Loading branch information
dzenanz committed Sep 10, 2024
1 parent 5222d74 commit d478b4a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion oai_analysis/mesh_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# Helper Functions for Mesh Processing

def read_vtk_mesh(filename):
if filename[-4:] == ".ply":
if str(filename)[-4:] == ".ply":
reader = vtk.vtkPLYReader()
else:
reader = vtk.vtkPolyDataReader()
Expand Down
7 changes: 2 additions & 5 deletions oai_analysis/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,8 @@ def analysis_pipeline(input_path, output_path, keep_intermediate_outputs):
atlas_filename = DATA_DIR / "atlases/atlas_60_LEFT_baseline_NMI/atlas.nii.gz"
atlas_image = itk.imread(atlas_filename, itk.F)

print("Computing cartilage thickness for the atlas")
inner_mesh_fc_atlas, inner_mesh_tc_atlas = thickness_analysis(atlas_image,
output_prefix=os.path.join(output_path, "atlas"))
write_vtk_mesh(inner_mesh_fc_atlas, output_path + "/inner_mesh_fc_atlas.vtk")
write_vtk_mesh(inner_mesh_tc_atlas, output_path + "/inner_mesh_tc_atlas.vtk")
inner_mesh_fc_atlas = mp.read_vtk_mesh(DATA_DIR / "atlases/atlas_60_LEFT_baseline_NMI/atlas_FC_inner_mesh_LPS.ply")
inner_mesh_tc_atlas = mp.read_vtk_mesh(DATA_DIR / "atlases/atlas_60_LEFT_baseline_NMI/atlas_TC_inner_mesh_LPS.ply")

print("Registering the input image to the atlas")
model = get_unigradicon()
Expand Down

0 comments on commit d478b4a

Please sign in to comment.