Describe Your Question
- I am trying to capture coordinates after I drawing a contour in an image dicom using Brush Tool of Cornerstone JS library.
- v1.14 (CornerstoneJS)
What steps can we follow to reproduce the bug?
- Create a new folder in packages/tools/examples and a index.ts file
- Add the follow code in your index.ts file:
// Crea un arreglo para almacenar las coordenadas del contorno
const contourCoordinates: cornerstone.Point = ;
element1.addEventListener(‘CORNERSTONE_TOOLS_MOUSE_MOVE’, (event: Event) => {
const eventData = event as CustomEvent;
//if (eventData.detail.toolType === ‘Brush’) {
// Obtiene las coordenadas del evento
const coords = eventData.detail.currentPoints.image;
// Almacena las coordenadas en el arreglo
contourCoordinates.push(coords);
//}
});
element1.addEventListener(‘CORNERSTONE_TOOLS_MOUSE_UP’, (event: Event) => {
const eventData = event as CustomEvent;
// Puedes hacer lo que desees con las coordenadas almacenadas en contourCoordinates
console.log('Coordenadas del trazado:', contourCoordinates);
// Limpia el arreglo de coordenadas después de obtenerlas
contourCoordinates.length = 0;
});
- Run your project