identify a single slice file name in 3D dicom volume

How can I identify a the file name of a single slice in a loaded 3D DICOM volume? I have loaded a DICOM directory with several hundred slices, but after I have identified a single slice of interest, I would like to know which file name it is.

You can use the python api like in the example linked below. The instanceUIDs attribute of the volume node can be used with fileForInstance() to get the path.

thanks for reply.

volumeName = “1302: Chest CE 3.0 I50f 2_1”

volumeNode = slicer.util.getNode(volumeName)

instUids = volumeNode.GetAttribute(“DICOM.instanceUIDs”).split()

filepath = slicer.dicomDatabase.fileForInstance(instUids[0])

print(“DICOM path=%s” % filepath)

I implemented this code , and the result of filepath was from DicomDatabase.
But i want the filepath from where I import the dicom file.

You can choose to copy the imported DICOM files into the database or just add a link to it. For example to con toggle this setting in the DICOM module by clicking the down-arrow button on the DICOM import button.

That said, filename is not the most robust way of referring to an image slice. Instead, the instance UID uniquely identifies the entire content of the image frame, globally, forever. If you have the UID then you can always retrieve the file from a local folder, from a DICOM server, from a local database, etc.

if i print(instUids) in this code, there are lot of UID , but i want to know only specific slice UID.
How can i know the index of slice file and approach to that?

In most cases, there is an instance UID for each slice. The slice index is the third voxel coordinate (K). You can convert RAS to IJK as shown in this example.