Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /trunk/src/compiler/fields/image-info.sml
ViewVC logotype

Annotation of /trunk/src/compiler/fields/image-info.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 165 - (view) (download)
Original Path: trunk/src/compiler/IL/image-info.sml

1 : jhr 106 (* image-info.sml
2 :     *
3 :     * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu)
4 :     * All rights reserved.
5 :     *
6 :     * Information about a NRRD file
7 :     *)
8 :    
9 :     structure ImageInfo : sig
10 :    
11 : jhr 165 datatype info = ImgInfo of {
12 :     id : OS.FileSys.file_id, (* ID of image file *)
13 : jhr 106 dim : int, (* dimension of space *)
14 :     ty : RawTypes.ty, (* types of scalar samples *)
15 :     origin : FloatLit.float list, (* center of first sample *)
16 : jhr 135 sizes : int list (* number of samples along each axis *)
17 : jhr 106 }
18 : jhr 165
19 :     (* are the underlying files the same? *)
20 :     val same : info * info -> bool
21 :    
22 :     (* hash value (based on image file ID) *)
23 :     val hash : info -> word
24 :    
25 :     (* get image info from a Nrrd file *)
26 : jhr 130 val getInfo : string -> info
27 : jhr 106
28 :     end = struct
29 :    
30 : jhr 165 datatype info = ImgInfo of {
31 :     id : OS.FileSys.file_id, (* ID of image file *)
32 : jhr 135 dim : int, (* dimension of space *)
33 :     ty : RawTypes.ty, (* types of scalar samples *)
34 :     origin : FloatLit.float list, (* center of first sample *)
35 :     sizes : int list (* number of samples along each axis *)
36 :     }
37 :    
38 : jhr 165 fun same (ImgInfo{id=a, ...}, ImgInfo{id=b, ...}) = (a = b)
39 :    
40 :     fun hash (ImgInfo{id, ...}) = OS.FileSys.hash id
41 :    
42 : jhr 135 fun getInfo fileName = let
43 :     val {version, header} = RunDNorm.run fileName
44 :     in
45 :     (* FIXME*)raise Fail "getInfo"
46 :     end
47 :    
48 : jhr 106 end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0