2 using System.Collections;
3 using UnityEngine.EventSystems;
7 public void OnPointerClick(UnityEngine.EventSystems.PointerEventData eventData )
10 DICOM dicom = DICOMLoader.instance.currentDICOM;
14 Vector3 worldPos = eventData.pointerCurrentRaycast.worldPosition;
16 Vector3 localPos = transform.InverseTransformPoint( worldPos );
18 Debug.Log (
"Clicked: " + worldPos +
" (local: " + localPos +
")" );
22 Vector3 pixel = dicom.transformPatientPosToPixel ( localPos );
23 Debug.Log (
"Pixel: " + pixel.x +
"," + pixel.y +
" on layer " + pixel.z);
26 Vector3 pixelRounded = dicom.transformPatientPosToDiscretePixel ( localPos );
27 Debug.Log (
"Rounded: " + pixelRounded.x +
"," + pixelRounded.y +
" on layer " + pixelRounded.z);
29 Debug.Log (
"No DICOM loaded." );