How can get id slice?

I try to get id slices when using tools in the SegmentEditor module. How can I get it?

I think there are a few different things you might mean. Do you mean segment IDs (a string of characters which uniquely identifies a segment within a segmentation)? Or a slice view ID (a string of characters which uniquely identifies one of the slice view areas, like the Red, Yellow, or Green slices)? Can you share a little more about what you are trying to do?

I would like to get (if they exist) model slicing identifiers. I need to save the values of identifiers after the interaction of the instrument on the scene. And I need to know that for each slide there is a unique identifier belonging only to it and not changing. I think it can be found in dicome or there is another way. Please explain how to find it. if I’m not right, tell me.
I guess I mean the second variant, but it’s not exactly

I am still having trouble understanding exactly what you are looking for. When you say the “interaction of the instrument on the scene”, are you referring to a surgical instrument (like for image-guided surgical interventions), or are you referring to a segment editor tool (like “Threshold” or “Smoothing”)?

There are unique identifiers in DICOM headers, but these don’t refer to Slicer objects, they instead allow cross referencing between DICOM files, so I’m not sure whether that is what you are looking for.

I mean segment editor tools (like “Draw”, “Scissors”, “Draw”)

Great, thanks. If we take a step back from the details, what are you trying to accomplish? If you had the identifiers you are looking for, what would you want to do with them?

I want to log id’s slice after instrument click on scene in red / green / yellow planes
If I move the slider, the current id of the viewed slice on which the tool draws will change.

OK, I think I am beginning to understand. You want to capture and log the image volume location where you click when using Segment Editor tools, is that correct?

I’m not sure whether there is an easy way to capture that information (the location of a click) while using Segment Editor effects, because I believe the Segment Editor effects capture the mouse click events and I’m not sure where you would intervene or get a signal from them to do your logging. @lassoan, @pieper, or @mau_igna_06, am I correct here? Is there an event @nicdubovic could respond to to achieve this logging while using Segment Editor effects?

When you are not in Segment Editor, an easy way to record locations (which you can then translate back into voxel array coordinates if desired) is through placing Markups control points.

You might find this discussion helpful: How to capture right clicked

I want to capture and log the image volume location where you click when using Segment Editor tools.

Please take a look at the attached picture. This is the output of the Data Probe. At the bottom of the picture (B 107_2 (217, 252, 180)), there are what looks like slice numbers displayed in different planes.
image

Here is another relevant discussion which you might find helpful: Print dataprobe text with shift key

But I try do it using C++. I have static method of class which can log information

Generally the way effects manage events is internal to the effect so there’s not a good way to log exactly what the events correspond to, but you could probably detect that events are happening (clicks or keystrokes) in a way that doesn’t interfere with the effect and log those along with the info from the DataProbe module. You can also know what effect was active at the time of the event, so things like paint should be easy enough to figure out.

2 Likes

The code would be basically the same in C++

Please tell me, is there a way to find out a slice ID (a string of characters which uniquely identifies one of the slice view areas, like the Red, Yellow, or Green slices)

These scripts should help:

https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html?highlight=sliceView#capture-slice-view-into-png-file-with-white-background