13 |
|
|
14 |
(* the subset of the axis kinds that Diderot can read and write *) |
(* the subset of the axis kinds that Diderot can read and write *) |
15 |
datatype axis_kind |
datatype axis_kind |
16 |
= KindSpace (* spatial domain *) |
= KindDomain (* any image domain *) |
17 |
|
| KindSpace (* spatial domain *) |
18 |
| KindList (* flat vector of values; used to represent tensors that do *) |
| KindList (* flat vector of values; used to represent tensors that do *) |
19 |
(* not have one of the shapes recoognized by Teem *) |
(* not have one of the shapes recoognized by Teem *) |
20 |
| KindScalar (* scalar *) |
| KindScalar (* scalar *) |
28 |
* http://teem.sourceforge.net/nrrd/format.html#kinds for info) |
* http://teem.sourceforge.net/nrrd/format.html#kinds for info) |
29 |
*) |
*) |
30 |
fun kindFromString s = (case s |
fun kindFromString s = (case s |
31 |
of "space" => SOME KindSpace |
of "domain" => SOME KindDomain |
32 |
|
| "space" => SOME KindSpace |
33 |
| "list" => SOME KindList |
| "list" => SOME KindList |
34 |
| "scalar" => SOME KindScalar |
| "scalar" => SOME KindScalar |
35 |
| "2-vector" => SOME Kind2Vector |
| "2-vector" => SOME Kind2Vector |
42 |
|
|
43 |
(* convert an axis kind to its nrrd enum constant *) |
(* convert an axis kind to its nrrd enum constant *) |
44 |
fun kindToEnum k = (case k |
fun kindToEnum k = (case k |
45 |
of KindSpace => "nrrdKindSpace" |
of KindDomain => "nrrdKindDomain" |
46 |
|
| KindSpace => "nrrdKindSpace" |
47 |
| KindList => "nrrdKindList" |
| KindList => "nrrdKindList" |
48 |
| KindScalar => "nrrdKindScalar" |
| KindScalar => "nrrdKindScalar" |
49 |
| Kind2Vector => "nrrdKind2Vector" |
| Kind2Vector => "nrrdKind2Vector" |