Last active
December 20, 2015 19:58
-
-
Save pieper/6186477 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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() | |
parent.setLayout(layout) | |
slider = ctk.ctkSliderWidget() | |
header = DICOMLib.DICOMHeaderWidget(parent) | |
layout.addWidget(slider) | |
layout.addWidget(header.widget) | |
parent.show() | |
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): | |
files.append(file) | |
slider.decimals = 0 | |
slider.maximum = len(files)-1 | |
callback = lambda v: header.setHeader(files[int(v)]) | |
slider.connect('valueChanged(double)',callback) | |
# dcmdump + textBrowser option | |
textBrowser = qt.QTextBrowser() | |
layout.addWidget(textBrowser) | |
callback = lambda v: textBrowser.setText(str(DICOMLib.DICOMCommand('dcmdump', [files[int(v)]] ).start())) | |
slider.connect('valueChanged(double)',callback) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.)