X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FMain.hs;h=c8ba34554feb27bb2cd4f0f2d16aa36b0f3bd34a;hb=1f9335668ce3ebd6a6b82851a7f658d371071c97;hp=4b375cf57df6d4b0dd0a2d886d3b1154e4e02af0;hpb=850eb18add24bc0b455b1691f3c979f80f8daec9;p=spline3.git diff --git a/src/Main.hs b/src/Main.hs index 4b375cf..c8ba345 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -2,34 +2,26 @@ module Main where import Data.Array.Repa ( - Array, - DIM1, DIM3, - Shape, Z(..), (:.)(..), - index, - reshape, - toList ) -import Data.Array.Repa.IO.Vector (readVectorFromTextFile) +import System.Environment (getArgs) ---import Grid(make_grid, zoom) - - -read_mri_data :: IO (Array DIM1 Int) -read_mri_data = readVectorFromTextFile "./data/mridata.txt" +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_mri_data - let mridata2 = reshape mri_shape mridata - let tmp = Data.Array.Repa.toList mridata2 - print tmp --- let g = make_grid 1 (Data.Array.Repa.toList mridata2) --- let output = zoom g 2 --- print "Hello, world." + 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 (8,8,1) + write_values_1d output out_file