[Ctk-developers] ctkDICOMBrowser - access to database from python?

Alireza Mehrtash mehrtash at bwh.harvard.edu
Wed Oct 1 14:21:59 EDT 2014


Hi Nicole,

You can access the Slicer DICOM database by slicer.dicomDatabase and add
new DICOM series to the current database as we've done in tciabrowser [1].
If you want to create a new database you can do the same as [2].

Hth,
Alireza


[1]
https://github.com/QIICR/TCIABrowser/blob/master/TCIABrowser/TCIABrowser.py#L725-L740
[2]
https://github.com/Slicer/Slicer/blob/master/Modules/Scripted/DICOM/DICOM.py#L57-L61


On Tue, Sep 30, 2014 at 7:17 PM, Nicole Aucoin <nicole at bwh.harvard.edu>
wrote:

> Hello,
>
> I'm working with a ctkDICOMBrowser from a python script but having
> problems getting at the database to add data programatically. I've seen
> that the browser uses the application's QSettings to determine the database
> directory, it's creating and opening a database okay (verified by adding
> some checks to the C++ file), but from python the dicomBrowser.database
> call is always coming back as None.
>
> Here's a code snippet that I'm running from the Python console in 3D
> Slicer:
>
> # use the default settings for the database directory
> dicomBrowser = ctk.ctkDICOMBrowser()
> print dicomBrowser.database
>
> It always prints None even though I see my print out from the
> setDatabaseDirectory method that shows isOpen() being true on the non null
> database.
>
> Is this a bug in the Python wrapping of the QSharedPointer of the database
> variable? Or are there some more steps that I need to include or a
> different way to access it?
>
> thanks,
> Nicole
>
>
> The information in this e-mail is intended only for the person to whom it
> is
> addressed. If you believe this e-mail was sent to you in error and the
> e-mail
> contains patient information, please contact the Partners Compliance
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you in
> error
> but does not contain patient information, please contact the sender and
> properly
> dispose of the e-mail.
>
> _______________________________________________
> Ctk-developers mailing list
> Ctk-developers at public.kitware.com
> http://public.kitware.com/mailman/listinfo/ctk-developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ctk-developers/attachments/20141001/e594dd5e/attachment-0002.html>


More information about the Ctk-developers mailing list