From: Michael Orlitzky Date: Mon, 29 Aug 2011 23:09:28 +0000 (-0400) Subject: Add the current Main module, which works alrightish. X-Git-Tag: 0.0.1~202 X-Git-Url: https://gitweb.michael.orlitzky.com/?p=spline3.git;a=commitdiff_plain;h=6c6ca17ba52b570cc50c1a9546ee9b6a5d3266fd Add the current Main module, which works alrightish. --- diff --git a/src/Main.hs b/src/Main.hs index b8edf9e..ef04e1e 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -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 = args !! 0 + 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 - write_values_1d output "output.txt" + let output = zoom g (8,8,1) + write_values_1d output out_file