module Main
where
---import Cube
---import Face
---import Grid
---import Misc (flatten)
---import Point
---import RealFunction
---import Tetrahedron
---import ThreeDimensional
+import Data.Array.Repa (
+ Array,
+ DIM1,
+ DIM3,
+ Shape,
+ Z(..),
+ (:.)(..),
+ index,
+ reshape,
+ toList
+ )
+import Data.Array.Repa.IO.Vector (readVectorFromTextFile)
+--import Grid(make_grid, zoom)
---find_point_value :: RealFunction Point
---find_point_value p = poly p
--- where
--- g0 = make_grid 1 trilinear
--- the_cubes = flatten (cubes g0)
--- good_cubes = filter ((flip contains_point) p) the_cubes
--- target_cube = head good_cubes
--- good_tets = filter ((flip contains_point) p) (tetrahedrons target_cube)
--- target_tetrahedron = head good_tets
--- poly = polynomial target_tetrahedron
+
+read_mri_data :: IO (Array DIM1 Int)
+read_mri_data = readVectorFromTextFile "./data/mridata.txt"
+
+mri_shape :: DIM3
+mri_shape = (Z :. 256 :. 256 :. 109)
main :: IO ()
-main = putStrLn "Hello, World."
+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."