8 |
|
|
9 |
structure Inputs : sig |
structure Inputs : sig |
10 |
|
|
|
(* |
|
|
datatype initialization |
|
|
= String of string |
|
|
| Bool of bool |
|
|
| Int of IntInf.int |
|
|
| Real of FloatLit.float |
|
|
| Tensor of int list * FloatLit.float vector |
|
|
| Seq of initialization list |
|
|
*) |
|
11 |
datatype init_from_nrrd |
datatype init_from_nrrd |
12 |
= DynSeq of string |
= DynSeq of string |
13 |
| Proxy of string * ImageInfo.info (* input image specified by proxy *) |
| Proxy of string * ImageInfo.info (* input image specified by proxy *) |
35 |
|
|
36 |
end = struct |
end = struct |
37 |
|
|
|
(* |
|
|
datatype initialization |
|
|
= String of string |
|
|
| Bool of bool |
|
|
| Int of IntInf.int |
|
|
| Real of FloatLit.float |
|
|
| Tensor of int list * FloatLit.float vector |
|
|
| Seq of initialization list |
|
|
*) |
|
38 |
datatype init_from_nrrd |
datatype init_from_nrrd |
39 |
= DynSeq of string |
= DynSeq of string |
40 |
| Proxy of string * ImageInfo.info (* input image specified by proxy *) |
| Proxy of string * ImageInfo.info (* input image specified by proxy *) |
51 |
|
|
52 |
fun hash (INP{name, ...}) = HashString.hashString name |
fun hash (INP{name, ...}) = HashString.hashString name |
53 |
|
|
|
(* |
|
|
fun initToString (String s) = String.concat["\"", String.toString s, "\""] |
|
|
| initToString (Bool b) = Bool.toString b |
|
|
| initToString (Int n) = if (n < 0) then "-" ^ IntInf.toString(~n) else IntInf.toString n |
|
|
| initToString (Real f) = FloatLit.toString f |
|
|
| initToString (Tensor(dims, vals)) = "[...]" |
|
|
| initToString (Seq vs) = String.concat["{", String.concatWith "," (List.map initToString vs), "}"] |
|
|
| initToString (DynSeq name) = String.concat["load(\"", name, "\")"] |
|
|
| initToString (Proxy(name, _)) = String.concat["image(\"", name, "\")"] |
|
|
| initToString (Image info) = ImageInfo.toString info |
|
|
*) |
|
54 |
fun initToString (DynSeq name) = String.concat["load(\"", name, "\")"] |
fun initToString (DynSeq name) = String.concat["load(\"", name, "\")"] |
55 |
| initToString (Proxy(name, _)) = String.concat["image(\"", name, "\")"] |
| initToString (Proxy(name, _)) = String.concat["image(\"", name, "\")"] |
56 |
| initToString (Image info) = ImageInfo.toString info |
| initToString (Image info) = ImageInfo.toString info |