Mercurial > hg > orthanc-stone
annotate OrthancStone/Resources/Documentation/Coordinates.txt @ 1836:5a6adbc20ace
cleanup cmake
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 12 Jun 2021 13:43:42 +0200 |
parents | 20a0aba0ede5 |
children |
rev | line source |
---|---|
1775
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 |
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 Some notes about the coordinate systems |
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 ======================================= |
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 |
1796
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
5 Different systems |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
6 ----------------- |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
7 |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
8 * "World" coordinates refer to (x,y,z) positions, typically expressed |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
9 in millimeters (according to the DICOM conventions), which allows to |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
10 define volumes and 3D cutting planes. |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
11 |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
12 As explained below, those coordinates actually correspond to |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
13 "patient" coordinates if rendering DICOM images. |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
14 |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
15 The "world" coordinates are *not* used by the Stone Web viewer, |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
16 because the latter is a 2D application. |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
17 |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
18 * "Scene" coordinates refer to (x,y) positions, typically expressed in |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
19 millimeters (as a byproduct of world coordinates), which allows to |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
20 define the 2D geometric elements that are part of the scene, and |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
21 Y-axis pointing downward. |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
22 |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
23 * "Canvas" coordinates refer to (x,y) subpixel positions that will be |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
24 blitted by a compositor onto a drawing canvas. The units are |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
25 floating-point pixels, with (0,0) corresponding to the center of the |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
26 display surface, and Y-axis pointing downward. The "canvas" |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
27 coordinates modify the "scene" coordinates according the zoom/pan |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
28 specified by the user. |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
29 |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
30 * "Pixels" coordinates refer to standard integer (x,y) coordinates of |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
31 the surface in memory. (0,0) is the top-left pixel. |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
32 |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
33 |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
34 Relations between 2D and 3D |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
35 --------------------------- |
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1779
diff
changeset
|
36 |
1775
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 * The 3D coordinates are expressed in the PATIENT system, *not* the |
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 "gantry" coordinates. As a consequence, the tags "Image Position |
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 Patient" (0020,0032) and "Image Orientation Patient" (0020,0037) |
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 describe the 3D geometry of a slice. |
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 |
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 * The tag "Patient Position" (0018,5100) could be used to convert from |
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 patient coordinates to gantry coordinates, but this would be useful |
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 to device manufacturers, whereas Stone primarly deals with users of |
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 modalities. |
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 |
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 * The "Image Position Patient" gives the 3D coordinates of the CENTER |
1779
9ab251c03eda
unit test VolumeRendering.TextureCorners
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1775
diff
changeset
|
48 of the top-left voxel of slice. |
1775
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 |
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 * In 2D compositors, the origin of a texture corresponds to the CORNER |
1779
9ab251c03eda
unit test VolumeRendering.TextureCorners
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1775
diff
changeset
|
51 of the top-left pixel of the texture (*not* to the center of this |
9ab251c03eda
unit test VolumeRendering.TextureCorners
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1775
diff
changeset
|
52 pixel). Roughly speaking, the operation "floor()" must be applied to |
9ab251c03eda
unit test VolumeRendering.TextureCorners
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1775
diff
changeset
|
53 move from canvas coordinates (floating-point numbers) to pixel |
9ab251c03eda
unit test VolumeRendering.TextureCorners
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1775
diff
changeset
|
54 coordinates in the image buffer (integer numbers). |
1775
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 |
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 * The classes deriving from "IVolumeSlicer" must pay to attention to |
fca942f4b4a7
fix conversion from voxel centers to texture borders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 convert from centers of 3D voxels to bounding boxes of 2D pixels. |