mridata <- read_values_3d mri_shape "./data/mridata.txt"
let g = make_grid 1 mridata
let output = zoom g 1
- print output
+ write_values_1d output "output.txt"
fromList,
index,
reshape,
+ size
)
-import Data.Array.Repa.IO.Vector (readVectorFromTextFile)
+import Data.Array.Repa.IO.Vector (readVectorFromTextFile,
+ writeVectorToTextFile)
import System.FilePath ()
import Test.QuickCheck (Arbitrary(..), Gen)
one_d <- read_values_1d path
return $ reshape sh one_d
+write_values_1d :: Values3D -> FilePath -> IO ()
+write_values_1d v3d path = do
+ let size3d = size $ extent v3d
+ let shape1d = (Z :. size3d)
+ let v1d = reshape shape1d v3d
+ writeVectorToTextFile v1d path
empty3d :: Values3D
empty3d = Data.Array.Repa.fromList (Z :. 0 :. 0 :. 0) []