-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathImage.mhd
76 lines (50 loc) · 2.44 KB
/
Image.mhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
ObjectType = Image
NDims = 3
ElementType = MET_UCHAR
ElementByteOrderMSB = False
DimSize = 1000 1000 1000
ElementSize = 1.6 1.6 1.6
Offset = 0 0 0
ElementDataFile = Image.raw.gz
//HeaderSize = 0
//OutputFormat = .raw.gz
//!__________ optional image processing (ordered) commands ____________
//!_________________ remove the '//' to activate _____________________
//! crop image [ Nxyz_begin Nxyz_end )
//crop 0 0 0 300 300 300
//! flip x direction with y or z
//direction z
//! manipulate voxel values: range [start end] -> value
//! replaceRange start end value
//replaceRange 0 127 0
//replaceRange 128 255 1
//! threshold image: [range] -> 0 (void-space), rest->1 (solid)
//threshold 0 128
//! ### Format Specifications:
//! All keyword data should be provided in a single line.
//!
//! The first unrecognised keyword together with the rest of the file will
//! be ignored.
//! DNS/PNM codes can read .am, .tif, .raw.gz, .raw and .txt/.dat files.
//! The format is detected from the image suffix in ElementDataFile keyword.
//! When the image format is .raw or .raw.gz, this file can be opened in
//! ImageJ/Fiji or Paraview to load the image. For tif images, you should
//! open the .tif file directly.
//! When using .raw.gz, .raw and the image is not UChar and not written
//! in little-endian, add the following keyword before the ElementDataFile
//! (voxelImage ignotres this):
//! ElementByteOrderMSB = True
//! When using .raw.gz image files, for compatibility with Fiji/Paraview, add
//! the following keyword before the ElementDataFile:
//! CompressedData = True
//! = is used only in the standard mhd keywords (the first 10 lines) but
//! not in the DNS/PNM commands and keywords.
//! When the image is in .tif format, all the keywords can be dropped, but
//! to ensure the voxel-size is correct the keywords ElementSize and
//! Offset can be provided to override those read from .tif tags.
//! In .tif format, the keyword DimSize is redundant and hence ignored.
//! lines BEGINING with "#" and "//" are considered as comments and skipped,
//! but no comment is allowed before the keyword ElementDataFile.
//! A syntax highlighting hack: associate the .mhd suffix with C++:
//! In geany in "Tools -> Configuration files -> filetype_extensions.conf"
//! or by menu "Document -> Set Filetype -> Programming Languages -> C++".