The Wayback Machine - https://web.archive.org/web/20141229074500/http://code.google.com/p/spyderlib/source/browse/spyderplugins/io_dicom.py
My favorites | Sign in
Project Home Downloads Wiki Issues Source
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# -*- coding:utf-8 -*-
"""Example of I/O plugin for loading DICOM files"""

import os.path as osp

try:
import dicom
def load_dicom(filename):
try:
name = osp.splitext(osp.basename(filename))[0]
return {name: dicom.ReadFile(filename).PixelArray}, None
except Exception as error:
return None, str(error)
except ImportError:
load_dicom = None

#===============================================================================
# The following statements are required to register this I/O plugin:
#===============================================================================
FORMAT_NAME = "DICOM images"
FORMAT_EXT = ".dcm"
FORMAT_LOAD = load_dicom
FORMAT_SAVE = None

Change log

0943fd32156a by Pierre Raybaut <pierre.raybaut> on May 16, 2013   Diff
Python 3 compatibility. First step towards
Python 3 support. Still unstable.
Needs more testing:
  * see internal console for issues with
module_completion
  * try to open Preferences dialog box (it
crashes Spyder on Windows)
  * ...
Go to: 
Project members, sign in to write a code review

Older revisions

f54a38a5fe80 by Pierre Raybaut <pierre.raybaut> on Jul 28, 2010   Diff
Spyder plugins: added support for
translations (see 'pylint' plugin
example)
2160f1c4fc69 by Pierre Raybaut <pierre.raybaut> on Jun 10, 2010   Diff
Globals explorer/Workspace: added
support for I/O plugins (package
"spyderplugins", example: module
"io_dicom.py")
All revisions of this file

File info

Size: 754 bytes, 23 lines
Powered by Google Project Hosting