8 |
|
|
9 |
structure ImageInfo : sig |
structure ImageInfo : sig |
10 |
|
|
11 |
val getInfo : string -> { |
datatype info = ImgInfo of { |
12 |
|
id : OS.FileSys.file_id, (* ID of image file *) |
13 |
dim : int, (* dimension of space *) |
dim : int, (* dimension of space *) |
14 |
ty : RawTypes.ty, (* types of scalar samples *) |
ty : RawTypes.ty, (* types of scalar samples *) |
15 |
origin : FloatLit.float list, (* center of first sample *) |
origin : FloatLit.float list, (* center of first sample *) |
16 |
?? |
sizes : int list (* number of samples along each axis *) |
17 |
} |
} |
18 |
|
|
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 |
|
val getInfo : string -> info |
27 |
|
|
28 |
|
val toString : info -> string |
29 |
|
|
30 |
end = struct |
end = struct |
31 |
|
|
32 |
|
datatype info = ImgInfo of { |
33 |
|
id : OS.FileSys.file_id, (* ID of image file *) |
34 |
|
dim : int, (* dimension of space *) |
35 |
|
ty : RawTypes.ty, (* types of scalar samples *) |
36 |
|
origin : FloatLit.float list, (* center of first sample *) |
37 |
|
sizes : int list (* number of samples along each axis *) |
38 |
|
} |
39 |
|
|
40 |
|
fun same (ImgInfo{id=a, ...}, ImgInfo{id=b, ...}) = (a = b) |
41 |
|
|
42 |
|
fun hash (ImgInfo{id, ...}) = OS.FileSys.hash id |
43 |
|
|
44 |
|
fun getInfo fileName = let |
45 |
|
val {version, header} = RunDNorm.run fileName |
46 |
|
in |
47 |
|
(* FIXME*)raise Fail "getInfo" |
48 |
|
end |
49 |
|
|
50 |
|
fun toString (ImgInfo{...}) = "IMAGE" (* FIXME *) |
51 |
|
|
52 |
end |
end |