Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
divital-coder committed Jan 7, 2025
1 parent 32da70d commit dc50541
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Documenter = "1"
DocumenterVitepress = "0.0.19, 0.0.20"
HDF5 = "0.17.2"
Interpolations = "0.15.1"
ITKIOWrapper = "0.0.2"
ITKIOWrapper = "0.0.3"
JLD = "0.13.5"
JSON = "0.21.4"
Parameters = "0.12.3"
Expand Down
4 changes: 2 additions & 2 deletions src/Load_and_save.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function load_images(path::String, modality::String)::Array{MedImage}

voxel_arr = ITKIOWrapper.loadVoxelData(path,spatial_meta)
voxel_arr = voxel_arr.dat
voxel_arr = permutedims(voxel_arr, (3, 2, 1))
voxel_arr = permutedims(voxel_arr, (1, 2, 3))
spatial_metadata_keys = ["origin", "spacing", "direction"]
spatial_metadata_values = [origin, spacing, direction]
spatial_metadata = Dictionaries.Dictionary(spatial_metadata_keys, spatial_metadata_values)
Expand All @@ -88,7 +88,7 @@ function create_nii_from_medimage(med_image::MedImage, file_path::String)
# Convert voxel_data to a numpy array (Assuming voxel_data is stored in Julia array format)
voxel_data_np = med_image.voxel_data
voxel_data_np = permutedims(voxel_data_np, (3, 2, 1))
# Create a SimpleITK image from numpy array
#Create a SimpleITK image from numpy array
sitk = pyimport("SimpleITK")
image_sitk = sitk.GetImageFromArray(voxel_data_np)

Expand Down

0 comments on commit dc50541

Please sign in to comment.