Skip to content

Commit

Permalink
Fixed upside down issue infigure displaying
Browse files Browse the repository at this point in the history
  • Loading branch information
nbwuzhe committed Apr 4, 2024
1 parent 802a34f commit 57495be
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/utils/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function plot_reconstruction(images, slices_index, b0; is_slice_interleaved = fa
end
magnitude_mosaic = mosaicview(magnitude_images, nrow = Int(floor(sqrt(num_slices))), npad = 5, rowmajor = true, fillvalue = 0)

p1 = Plots.heatmap(magnitude_mosaic, show = false, title = "|Images|", color = :grays, aspect_ratio = 1, colorbar=:none, grid=:none, showaxis=:false)
p1 = Plots.heatmap(magnitude_mosaic, show = false, title = "|Images|", color = :grays, aspect_ratio = 1, yflip=true, colorbar=:none, grid=:none, showaxis=:false)
display(p1)

phase_images = angle.(images[:, :, reordered_slice_indices, 1, 1])
Expand All @@ -49,7 +49,7 @@ function plot_reconstruction(images, slices_index, b0; is_slice_interleaved = fa
end
phase_mosaic = mosaicview(phase_images, nrow = Int(floor(sqrt(num_slices))), npad = 5, rowmajor = true, fillvalue = 0)

p2 = Plots.heatmap(phase_mosaic, show = false, title = "∠ Images", color = :plasma, aspect_ratio = 1, colorbar=:none, grid=:none, showaxis=:false)
p2 = Plots.heatmap(phase_mosaic, show = false, title = "∠ Images", color = :plasma, aspect_ratio = 1, yflip=true, colorbar=:none, grid=:none, showaxis=:false)
display(p2)

b0_map_images = mapslices(x -> x, b0, dims = [1, 2])
Expand All @@ -62,7 +62,7 @@ function plot_reconstruction(images, slices_index, b0; is_slice_interleaved = fa
end
b0_map_mosaic = mosaicview(b0_map_images[:, :, reordered_slice_indices], nrow = Int(floor(sqrt(num_slices))), npad = 5, rowmajor = true, fillvalue = 0)

p3 = Plots.heatmap(b0_map_mosaic, show = false, title = "B₀ Map Images", color = :plasma, aspect_ratio = 1, colorbar=:right, grid=:none, showaxis=:false)
p3 = Plots.heatmap(b0_map_mosaic, show = false, title = "B₀ Map Images", color = :plasma, aspect_ratio = 1, yflip=true, colorbar=:right, grid=:none, showaxis=:false)
display(p3)
end

Expand Down Expand Up @@ -112,10 +112,10 @@ function plot_sense_maps(sensitivity, num_channels; slice_index = 1)
end

magnitude_mosaic = mosaicview((abs.(sensitivity[:, :, slice_index, :])), nrow = Int(floor(sqrt(num_channels))), npad = 5, rowmajor = true, fillvalue = 0)
p4 = Plots.heatmap(magnitude_mosaic, show = false, title = "|Sensitivity|", color = :gnuplot2, aspect_ratio = 1, colorbar=:none, grid=:none, showaxis=:false)
p4 = Plots.heatmap(magnitude_mosaic, show = false, title = "|Sensitivity|", color = :gnuplot2, aspect_ratio = 1, yflip=true, colorbar=:none, grid=:none, showaxis=:false)

phase_mosaic = mosaicview((angle.(sensitivity[:, :, slice_index, :])), nrow = Int(floor(sqrt(num_channels))), npad = 5, rowmajor = true, fillvalue = 0)
p5 = Plots.heatmap(phase_mosaic, show = false, title = "∠ Sensitivity", color = :plasma, aspect_ratio = 1, colorbar=:none, grid=:none, showaxis=:false)
p5 = Plots.heatmap(phase_mosaic, show = false, title = "∠ Sensitivity", color = :plasma, aspect_ratio = 1, yflip=true, colorbar=:none, grid=:none, showaxis=:false)

display(p4)
display(p5)
Expand Down

0 comments on commit 57495be

Please sign in to comment.