SCM Repository
View of /trunk/src/compiler/IL/image-info.sml
Parent Directory
|
Revision Log
Revision 165 -
(download)
(annotate)
Wed Jul 21 15:20:53 2010 UTC (11 years, 11 months ago) by jhr
File size: 1320 byte(s)
Wed Jul 21 15:20:53 2010 UTC (11 years, 11 months ago) by jhr
File size: 1320 byte(s)
Adding equality tests and hashing support
(* image-info.sml * * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu) * All rights reserved. * * Information about a NRRD file *) structure ImageInfo : sig datatype info = ImgInfo of { id : OS.FileSys.file_id, (* ID of image file *) dim : int, (* dimension of space *) ty : RawTypes.ty, (* types of scalar samples *) origin : FloatLit.float list, (* center of first sample *) sizes : int list (* number of samples along each axis *) } (* are the underlying files the same? *) val same : info * info -> bool (* hash value (based on image file ID) *) val hash : info -> word (* get image info from a Nrrd file *) val getInfo : string -> info end = struct datatype info = ImgInfo of { id : OS.FileSys.file_id, (* ID of image file *) dim : int, (* dimension of space *) ty : RawTypes.ty, (* types of scalar samples *) origin : FloatLit.float list, (* center of first sample *) sizes : int list (* number of samples along each axis *) } fun same (ImgInfo{id=a, ...}, ImgInfo{id=b, ...}) = (a = b) fun hash (ImgInfo{id, ...}) = OS.FileSys.hash id fun getInfo fileName = let val {version, header} = RunDNorm.run fileName in (* FIXME*)raise Fail "getInfo" end end
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |