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

Nicole Aucoin nicole at bwh.harvard.edu
Wed Oct 1 18:53:05 UTC 2014


Hi Alireza,

I've been working in DICOM.py to debug this issue so I've been following 
that template, starting with an empty directory and a new database. I 
wanted to avoid using slicer.dicomDatabase since once of the use cases 
is for a stand alone program.

Nicole

On 10/1/14 2:21 PM, Alireza Mehrtash wrote:
> 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 
> <mailto: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
>     <mailto:Ctk-developers at public.kitware.com>
>     http://public.kitware.com/mailman/listinfo/ctk-developers
>
>




More information about the Ctk-developers mailing list