4 import qualified Data.Array.Repa as R
5 import System.Environment (getArgs)
12 in_file = "./data/mri.bin"
21 let scale = read s :: Int
22 let zoom_factor = (scale, scale, scale)
23 let out_file = "output.bin"
24 arr <- read_word16s in_file
25 let arr' = swap_bytes arr
26 let arrMRI = R.reshape mri_shape arr'
27 let dbl_data = R.force $ R.map fromIntegral arrMRI
28 let output = zoom dbl_data zoom_factor
29 let word16_output = round_array output
30 write_word16s out_file word16_output
36 let scale = read s :: Int
37 let zoom_factor = (1, scale, scale)
38 let out_file = "output.bmp"
39 arr <- read_word16s in_file
40 let arr' = swap_bytes arr
41 let arrInv = flip_x $ flip_y arr'
42 let arrSlice = z_slice 50 arrInv
43 let arrSlice' = R.reshape mri_slice3d arrSlice
44 let dbl_data = R.map fromIntegral arrSlice'
45 let output = zoom dbl_data zoom_factor
46 write_values_slice_to_bitmap (z_slice 0 output) out_file