# How to get crosshair position for three MRI series

**URL:** <https://discourse.vtk.org/t/how-to-get-crosshair-position-for-three-mri-series/16028>\
**Category:** Development\
**Tags:** code\
**Created:** [September 11, 2025, 8:47am UTC](https://discourse.vtk.org/t/how-to-get-crosshair-position-for-three-mri-series/16028 "2025-09-11T08:47:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chekushka.borodin](https://discourse.vtk.org/user_avatar/discourse.vtk.org/chekushka.borodin/32/10274_2.png) [@chekushka.borodin](https://discourse.vtk.org/u/chekushka.borodin)\
**Post date:** [September 11, 2025, 8:47am UTC](https://discourse.vtk.org/t/how-to-get-crosshair-position-for-three-mri-series/16028/1 "2025-09-11T08:47:09Z")

</div>

Hi everyone  
I am writing a program, but I am stuck at one stage, namely getting the crosshair position by the current slice number in MRI series

I did a great job of doing this for the CT series, but that’s probably because I reconstruct the other two planes from the axial one myself

```cpp
Coordinate CrosshairManager::getCoordinateCT(const SliceDirection& targetDir) const
{
int targetIndex = static_cast(targetDir);
int sagittalIndex = static_cast(SliceDirection::Sagittal);
int coronalIndex = static_cast(SliceDirection::Coronal);
int axialIndex = static_cast(SliceDirection::Axial);
Coordinate normCoord;

switch (targetDir)
{
	case SliceDirection::Axial:
	{
		normCoord.setXYZ
		(
			static_cast<double>(sliceIndices[sagittalIndex]) / (maxSliceIndices[sagittalIndex]),
			static_cast<double>(sliceIndices[coronalIndex]) / (maxSliceIndices[coronalIndex])
		);
		break;
	}
	case SliceDirection::Sagittal:
	{
		normCoord.setXYZ
		(
			static_cast<double>(sliceIndices[coronalIndex]) / (maxSliceIndices[coronalIndex]),
			static_cast<double>(sliceIndices[axialIndex]) / (maxSliceIndices[axialIndex])
		);
		break;
	}
	case SliceDirection::Coronal:
	{
		normCoord.setXYZ
		(
			static_cast<double>(sliceIndices[sagittalIndex]) / (maxSliceIndices[sagittalIndex]),
			static_cast<double>(sliceIndices[axialIndex]) / (maxSliceIndices[axialIndex])
		);
		break;
	}
}

return applyFlipToCoordinate(normCoord, targetDir);
}

```

But for MRI I can’t perfectly hit the same point in all planes, I checked the work with the Radiant program

My data:  
Three separate MRI series, their dimensions are 480x480xSliceCount  
In Saggital 22 slices  
In Coronal 25 slices  
In Axial 26 slices
