]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - src/Main.hs
Fix the Cube tests re: the 'tetrahedron' change.
[spline3.git] / src / Main.hs
index 7b50de9ee3c02fab3e40a7d662198f4fca531a41..c8ba34554feb27bb2cd4f0f2d16aa36b0f3bd34a 100644 (file)
@@ -7,15 +7,21 @@ import Data.Array.Repa (
   (:.)(..),
   )
 
-import Values
-import Grid(make_grid, zoom)
+import System.Environment (getArgs)
+
+import Values (read_values_3d, write_values_1d)
+import Grid (make_grid, zoom)
 
 mri_shape :: DIM3
-mri_shape = (Z :. 256 :. 256 :. 109)
+mri_shape = (Z :. 256 :. 256 :. 1)
 
 main :: IO ()
 main = do
-  mridata <- read_values_3d mri_shape "./data/mridata.txt"
+  args <- getArgs
+  let color = head args
+  let in_file  = "./data/MRbrain.40." ++ color
+  let out_file = "MRbrain.40." ++ color ++ ".out"
+  mridata <- read_values_3d mri_shape in_file
   let g = make_grid 1 mridata
-  let output = zoom g 1
-  print output
+  let output = zoom g (8,8,1)
+  write_values_1d output out_file