Skip to content

Instantly share code, notes, and snippets.

Last active Dec 20, 2015
What would you like to do?
The following can be pasted into the python console to examine the headers
of all the dicom objects in the database
import DICOMLib
parent = qt.QWidget()
layout = qt.QVBoxLayout()
slider = ctk.ctkSliderWidget()
header = DICOMLib.DICOMHeaderWidget(parent)
db = slicer.dicomDatabase
files = []
for patient in db.patients():
for study in db.studiesForPatient(patient):
for series in db.seriesForStudy(study):
for file in db.filesForSeries(series):
slider.decimals = 0
slider.maximum = len(files)-1
callback = lambda v: header.setHeader(files[int(v)])
# dcmdump + textBrowser option
textBrowser = qt.QTextBrowser()
callback = lambda v: textBrowser.setText(str(DICOMLib.DICOMCommand('dcmdump', [files[int(v)]] ).start()))

This comment has been minimized.

Copy link
Owner Author

@pieper pieper commented Oct 11, 2013

Just paste this into the python interpreter and it will let you look at all the headers in your database. Use the raw text link (click on the icon on the top right that looks like <> next to the little chain link icon.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment