Skip to content

Commit e05415b

Browse files
committed
ENH: Move PIL import to local scope.
Now it is optional unless someone wants PNG conversion in dicomfs. Note this fact in the installation docs.
1 parent aef64fc commit e05415b

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

doc/source/installation.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Requirements
7474
* NumPy_ 1.2 or greater
7575
* SciPy_ (for full SPM-ANALYZE support)
7676
* PyDICOM_ 0.9.5 or greater (for DICOM support)
77+
* `Python Imaging Library`_ (for PNG conversion in DICOMFS)
7778
* nose_ 0.11 or greater (to run the tests)
7879
* sphinx_ (to build the documentation)
7980

doc/source/links_names.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
.. _setuptools: http://pypi.python.org/pypi/setuptools
9393
.. _distribute: http://packages.python.org/distribute
9494
.. _datapkg: http://okfn.org/projects/datapkg
95+
.. _python imaging library: http://www.pythonware.com
9596

9697
.. Python imaging projects
9798
.. _PyMVPA: http://www.pymvpa.org

nibabel/dft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import numpy
1616
import nibabel
1717
import sqlite3
18-
import PIL.Image
1918
import dicom
2019

2120
_study_instance_uid_tag = dicom.tag.Tag(0x0020, 0x000d)
@@ -133,6 +132,7 @@ def __getattribute__(self, name):
133132
return val
134133

135134
def as_png(self, index=None, scale_to_slice=True):
135+
import PIL.Image
136136
if index is None:
137137
index = len(self.storage_instances) / 2
138138
d = self.storage_instances[index].dicom()

0 commit comments

Comments
 (0)