Adding custom tags to subject without creating/exporting DICOMs

Is it possible to set and display some of the DICOM tags from the subject hierarchy without actually having a dicom volume ? E.g., I organized this mockup MRB file. It contains everything I need in terms of imaging data (an NRRD file), segmentation and exported model, fiducials etc. I still need to describe the genus/species/strains/sex (and few other things as well) of this subject AMNH123456. If I choose to export one of the volume as a DICOM, I get to specify some of those. But I don’t want to do that, but retain my volumes as NRRD/NII for convenience and skip the unnecessary export step.

What I was looking/hoping for is some sort of functionality, where I right click on the subject, and then choose something like ‘create custom tag/metadata field’, and then start populating them as I need. Or even a way to specify/declare these custom tags only once, so that we don’t make typos entering them manually all the time (species vs speices kind of thing). Then, these tags gets stored in the mrml/mrb file. My goal is being able to access this information programmatically for batch processing, as well as making sure some metadata travels with the dataset.

I am not sure if this is currently possible. How difficult would it be to implement something this?

image

You can set subject hierarchy attributes using shNode.SetItemAttribute method as shown in this post: Hausdorff distance calculation in SegmentComparison module

If this scripting interface is not convenient enough then you can add items add an item to the right-click menu that shows a popup where you can add/edit/delete item attributes. You can add menu items using Subject Hierarchy plugin, using either Python or C++. See this example that adds a “Calculate statistics…” menu item. If we find that this need comes up often then we can add the plugin in Slicer core or maybe add an attribute editor similar to the node attribute editor in the Data module.

Another approach could be to just create a table node in the scene that contains whatever information you think is important to track. This would save/restore with the MRB, but could also be easily exported as csv (or cut and paste) for use with Excel or whatever. You could also create a template and part of the workflow would be to create the table either in Slicer or elsewhere when accessioning the study.

Actually tables might work. However, when I save as csv/tsv file and reload it in the scene, it doesn’t remember the customization I did (like locking columns, rows so those values cannot be manually changed). Are those handled by the mrml scene?

Locking columns and rows should be saved in the scene. Let me know if you find that it is not.