Class IndexHelper
Has helpful methods for converting from an index to x,y,z coordinates in a pixel lattice and visa versa
Inheritance
Inherited Members
Namespace:EvilDICOM.Core.Helpers
Assembly:EvilDICOM.dll
Syntax
public class IndexHelper
Methods
View SourceIndexToLatticeXY(Int32, Int32)
Converts a input 1D index of a pixel in a lattice to the X, Y coordinates of the pixel
Declaration
public static (int x, int y) IndexToLatticeXY(int index, int dimX)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | the 1D index of the pixel |
| System.Int32 | dimX | the width of the lattice in the X direction |
Returns
| Type | Description |
|---|---|
| System.ValueTuple<System.Int32, System.Int32> | a value tuple of the X,Y,Z coordiantes |
IndexToLatticeXYZ(Int32, Int32, Int32)
Converts a input 1D index of a pixel in a lattice to the X, Y, Z coordinates of the pixel
Declaration
public static (int x, int y, int z) IndexToLatticeXYZ(int index, int dimX, int dimY)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | the 1D index of the pixel |
| System.Int32 | dimX | the width of the lattice in the X direction |
| System.Int32 | dimY | the height of the lattice in the Y direction |
Returns
| Type | Description |
|---|---|
| System.ValueTuple<System.Int32, System.Int32, System.Int32> | a value tuple of the X,Y,Z coordiantes |
LatticeXYToIndex(Int32, Int32, Int32)
Converts X,Y coordinates in a 2D pixel lattice to a 1D index
Declaration
public static int LatticeXYToIndex(int x, int y, int dimX)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | x | the x coordinate of the pixel |
| System.Int32 | y | the y coordinate of the pixel |
| System.Int32 | dimX | the width of the lattice in the X direction |
Returns
| Type | Description |
|---|---|
| System.Int32 | the index of the pixel in the 2D lattife |
LatticeXYZToIndex(Int32, Int32, Int32, Int32, Int32)
Converts X,Y,Z coordinates in a 3D pixel lattice to a 1D index
Declaration
public static int LatticeXYZToIndex(int x, int y, int z, int dimX, int dimY)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | x | the x coordinate of the pixel |
| System.Int32 | y | the y coordinate of the pixel |
| System.Int32 | z | the z coordinate of the pixel |
| System.Int32 | dimX | the width of the lattice in the X direction |
| System.Int32 | dimY | the height of the lattice in the Y direction |
Returns
| Type | Description |
|---|---|
| System.Int32 | the index of the pixel in the 3D lattice |