forked from ImperialCollegeLondon/pnextract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImage.mhd
70 lines (46 loc) · 2.19 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
ObjectType = Image
NDims = 3
ElementType = MET_UCHAR
DimSize = 1000 1000 1000
ElementSpacing = 1.6 1.6 1.6
Offset = 0 0 0
ElementDataFile = Image.raw.gz
DefaultImageFormat = tif
'______________ optional image processing commands _________________'
''' crop image to [ Nxyz_begin Nxyz_end )'''
#cropD 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 .tif, .raw.gz, .raw and .txt/.dat files. The
format is detected based on the suffix of the image, given by
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.
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
= 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 ElementSpacing 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.
"'" doesn't apply multiline comments; it only highlighs, see below.
A syntax highlighting hack: associate the .mhd suffix with python:
In geany in "Tools -> Configuration files -> filetype_extensions.conf"
or by menu "Document -> Set Filetype -> Scripting Languages -> Python".
'''