From: Michael Orlitzky Date: Wed, 21 Sep 2011 00:34:13 +0000 (-0400) Subject: Add the round_array function and use it in main3d. X-Git-Tag: 0.0.1~126 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=c8ec035a77f871e4deaa976ed6f3a65a32c07048;p=spline3.git Add the round_array function and use it in main3d. --- diff --git a/src/MRI.hs b/src/MRI.hs index 8e2b0ac..510e4c0 100644 --- a/src/MRI.hs +++ b/src/MRI.hs @@ -70,11 +70,15 @@ swap_bytes :: (Shape sh) => (RawData sh) -> (RawData sh) swap_bytes arr = R.force $ R.map flip16 arr + bracket_array :: (Shape sh) => (Values sh) -> (RawData sh) bracket_array arr = - R.force $ R.map f arr - where - f = bracket + R.force $ R.map bracket arr + + +round_array :: (Shape sh) => (Values sh) -> (RawData sh) +round_array arr = + R.force $ R.map round arr flip_y :: RawData3D -> RawData3D diff --git a/src/Main.hs b/src/Main.hs index e577351..0afe2f7 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -15,7 +15,6 @@ in_file = "./data/mri.bin" main :: IO () main = main3d - main3d :: IO () main3d = do (s:_) <- getArgs @@ -27,7 +26,7 @@ main3d = do let arrMRI = R.reshape mri_shape arr' let dbl_data = R.force $ R.map fromIntegral arrMRI let output = zoom dbl_data zoom_factor - let word16_output = bracket_array output + let word16_output = round_array output write_word16s out_file word16_output