{-# INLINE swap_bytes #-}
-swap_bytes :: (Shape sh, Repr r Word16) => Array r sh Word16
+swap_bytes :: (Shape sh, Source r Word16) => Array r sh Word16
-> Array D sh Word16
swap_bytes =
R.map flip16
R.map round
-flip_y :: Repr r Word16 => Array r DIM3 Word16 -> Array D DIM3 Word16
+flip_y :: Source r Word16 => Array r DIM3 Word16 -> Array D DIM3 Word16
flip_y arr =
R.unsafeTraverse arr id
(\get (Z :. z :. y :. x) ->
get (Z :. z :. (mri_height - 1) - y :. x))
-flip_x :: Repr r Word16 => Array r DIM3 Word16 -> Array D DIM3 Word16
+flip_x :: Source r Word16 => Array r DIM3 Word16 -> Array D DIM3 Word16
flip_x arr =
R.unsafeTraverse arr id
(\get (Z :. z :. y :. x) ->
b' = truncate (b * 255)
-z_slice :: (R.Unbox a, Repr r a) => Int -> Array r DIM3 a -> Array D DIM2 a
+z_slice :: (R.Unbox a, Source r a) => Int -> Array r DIM3 a -> Array D DIM2 a
z_slice n arr =
slice arr (Any :. n :. All :. All)