Giter VIP home page Giter VIP logo

pydicom's People

Contributors

darcymason avatar dimitripapadopoulos avatar fmorency avatar nilgoyette avatar pawelzajdel avatar suever avatar

Watchers

 avatar

Forkers

adler-j

pydicom's Issues

Add more example DICOM files to tests

Find more DICOM files for the test suite. 
  * newer DICOM files
  * if possible more variations such as BigEndian, multi-frame images,
compressed images

Original issue reported on code.google.com by [email protected] on 13 Sep 2008 at 3:15

Add logging

Use python logging module to:
  * record the attributes as they are read or written
  * capture assumptions -- e.g. with no header found
  * capture any warnings about dicom non-compliance
  * capture detailed information for exceptions

Original issue reported on code.google.com by [email protected] on 23 Sep 2008 at 9:25

Check into JPEG syntaxes

Find example JPEG syntax files and make sure they can be read (but leave
decompression to the user).

Original issue reported on code.google.com by [email protected] on 21 Sep 2008 at 3:12

Private tag VR UN loading as list instead of string

Using the following code on the provided image:

dcm = dicom.ReadFile( 'image.dcm' ) # Attached to this issue as 7-zip
dcm.PatientsName = 'Blah'
dcm.SaveAs( 'image2.dcm' )

Gives the following exception:
argument 1 must be string or buffer, not list

The save fails because tag (0045,1029) is a VR=UN with VM=1, yet the values 
are stored in a list (must be stored in string to save).  The value stored 
in the dicom file is a 'delimited' value of "1356\1" which is why I'm sure 
it's being stored as the list ["1356", "1"].  However, if the VM is 1, 
and/or VR type UN requires a string to save, then the loading code should 
load the value "1356\1" as a string literal and not a python list.


Original issue reported on code.google.com by [email protected] on 18 Dec 2008 at 10:21

Attachments:

Add support for python3.0

As of mid-Sept/08, python 3.0 release candidate is out. This changes many
features of the language, some in ways that are not backward compatible.
pydicom code will have to change (perhaps a fork) to run under python 3.0.
It will be some time before python 3.0 is widely adopted, however.

Original issue reported on code.google.com by [email protected] on 26 Sep 2008 at 8:16

Alternate packaging/installation

Investigate the follow methods to deliver pydicom:
  * pypi Python Packaging index http://pypi.python.org/
  * easy_install (linked to the above, I think)
  * others?

Original issue reported on code.google.com by [email protected] on 14 Sep 2008 at 2:54

Explicitly identify ambiguous VRs like OW/OB

Some dictionary items are OW/OB, 'US or SS' etc. See if can resolve which
was actually used and read with appropriate byte swapping if required.
  * e.g. PixelData is OB for encapsulated formats -- PS 3.5-2008 A.4


Original issue reported on code.google.com by [email protected] on 12 Oct 2008 at 1:44

Improve handling of missing header

If header missing, should be more careful about auto-detecting whether is
DICOM or not. Can for example compare group value to guess if big or little
endian.

Original issue reported on code.google.com by [email protected] on 16 Oct 2008 at 10:48

Use python Decimal for VR of DS

Code could be simplified by using python's Decimal object for VR=DS types -
- will track number of figures automatically, print nicely, etc. Math 
operations should be unaffected.

Original issue reported on code.google.com by [email protected] on 14 May 2009 at 12:14

Update dictionary to 2008 standard

Dictionary based on 03 standard. Need to update to 2008 documents. This
will entail:
  * adding tags to the dictionary
  * dealing with more "xx" groups and "xxx" elements
  * will update dictionary to include flag for whether the tag is retired
  * add a boolean attibute property isRetired
  * ? consider one-time pickling operation to speed loading since
dictionary will be much larger

Original issue reported on code.google.com by [email protected] on 16 Sep 2008 at 3:34

test_valuerep not working in python 2.3

Python 2.3 doesn't know euc_kr and iso2022_jp encodings used in latest 
revisions in repository. Need to remove this test or find alternatives 
based on python version.



Original issue reported on code.google.com by [email protected] on 22 Dec 2008 at 6:43

Multi-valued items exceed maxbytes for display

Attribute class str() display usually truncates large items. But if
multi-valued (a list) then len(value) can be small (the number of items in
the list) but the printed list very large. Saw this in Senographe file with
LUTs.
 Need to check the overall length of the output in case of lists.

Original issue reported on code.google.com by [email protected] on 10 Dec 2008 at 4:33

  • Merged into: #26

Create PIL connections

Create a new module to turn pydicom into a plug-in for PIL. Instructions at
http://www.pythonware.com/library/pil/handbook/decoder.htm

Original issue reported on code.google.com by [email protected] on 8 Oct 2008 at 4:20

Incorrectly populates with Null Procedure Code Sequence

1. I'm working with mammography data from GE Senographe Essential burned 
from the Review Workstation.  There is a null sequence (0008, 1032) 
ProcedureCodeSequence.  pydicom seems to place all tags past that sequence 
inside of it such that PatientsName, PatientsID, etc.. are considered part 
of the sequence instead of in the document root as they should be.

I loaded the file in other dicom apps (Jdicom, ClearCanvas, Matlab), and 
all apps parse these files correctly.  Perhaps there is a bug handling null 
sequences?

Using pydicom 0.9.1, WinXP 32-bit Python 2.5.2



Original issue reported on code.google.com by [email protected] on 24 Nov 2008 at 7:40

Reorganize test images

As adding more images, is cluttering the test directory. Restructure so
images have their own subfolder.

Original issue reported on code.google.com by [email protected] on 16 Oct 2008 at 10:46

Encrypted Content

Need code to handle encrypted content as per e.g PS 3.15-2008
Page 32

Original issue reported on code.google.com by [email protected] on 5 Apr 2009 at 3:49

DICOM multi-frame

1. Open DCM multi-frame file
2. Can't read frames or treat it as well

I'm wondering if pydicom supports multi-frame :?

What version of the product are you using? On what operating system?
Latest version with WinXP

Original issue reported on code.google.com by [email protected] on 14 May 2009 at 8:37

Quick reading of file info, avoiding large items

filereader.ReadFileMetaInfo() can avoid reading a whole file but only gives
limited information. Should add the ability to still read all information
but delay reading of large *values* (e.g. pixels, dose grid) until actually
needed. 
Possible solution: have a flag in Attribute instance to mark whether has
actually been read in. A danger of this is that one has to re-open the file
to read those values ... if any changes have been made to the file then
this could be dangerous. Will need a flag for date/time stamp and/or
recheck the instance UID to make sure is same file.


Original issue reported on code.google.com by [email protected] on 1 Dec 2008 at 10:35

Add reference pages

Need one or more wiki pages to explaing the classes and methods available
in more detail.

Original issue reported on code.google.com by [email protected] on 13 Sep 2008 at 12:45

PixelArray property not found when error raised in _getPixelArray

What steps will reproduce the problem?
1. read_file() for dicom file without header info
2. didn't add ds.TransferSyntaxUID checked in PixelArray (corrected in 
r109)
3. PixelArray reported as not a member of Dataset

So, root problem is that raised errors were somehow silenced ... and wound 
up going to __getattr__ to find a property which should have existed.



Original issue reported on code.google.com by [email protected] on 4 May 2009 at 7:42

(0018,9445) blank in dictionary

See http://groups.google.com/group/pydicom/browse_thread/thread/2e38bcdbf57891e
5.
The entry for (0018,9445) (retired) has blank entries, and should get some 
kind of definition.

Original issue reported on code.google.com by [email protected] on 10 Apr 2009 at 2:51

Harmonize pixel data representations

A pydicom "gotcha" comes from disconnect between Dataset.pixel_array 
property and Dataset.PixelData. The latter is actually in the Dataset (a 
dict), the former is created from it but changes are not written back 
unless ds.PixelData is explicitly set with e.g. pixel_array.tostring().

Possible solutions:

* always require Numpy, always convert pixel data into numpy array. Problem 
is this requires decompressing JPEG data (which is not available yet in 
pydicom and would possibly waste time on a step that might never be used if 
the code is not modifying pixels).

* link pixel_array and PixelData together. if pixel_array is asked for, 
keep reference to it in dataset instance and automatically do tostring() 
before data is written. But what if user modified pixel_array and modified 
PixelData directly (current code would do that using the tostring() method 
mentioned above). Could see which one was modified most recently and use 
that as the definitive final value, or could throw an error or warning of 
possible inconsistent pixel data changes. 
This idea means PixelData probably needs to be redefined as a property so 
can flag writes to it. That makes it 'special' and different than other 
items in the Dataset dict, but perhaps that is necessary.

I like the second idea better, but am hoping someone can come up with an 
even cleaner solution.


Original issue reported on code.google.com by [email protected] on 28 May 2009 at 2:58

Test with python 2.6

There may be incompatibilities with python 2.6. Test and see if pydicom
works with it.

Original issue reported on code.google.com by [email protected] on 21 Oct 2008 at 3:54

Style convention

Rename variables, functions etc according to standard python style
conventions, at least for most things.
In particular, change ReadFile to read_file etc. (can keep old one for
backwards compatibility).

Original issue reported on code.google.com by [email protected] on 13 Oct 2008 at 3:50

Automate testing (including example programs) for package releases

To simplify package release, need automated tests (ideally unit tests, but 
possibly scripts) to run the example programs (in examples directory) and:
* at least ensure they do not throw errors
* ideally, verify that they give the expected results

As unit tests, 
* create test_examples.py file in "test" directory from copy of an existing 
testset
* use execfile to run programs?
* capture stderr and ensure no errors thrown?
* capture stdout and sample for some expected printed values?

Have to consider how to run GUI examples -- i.e. dicomtree.py. May not be 
able to automate checking, in which case it should not go in unittests.


Original issue reported on code.google.com by [email protected] on 20 May 2009 at 1:38

Name collision for Sequence/non-sequence

See r95, r96. Temp fix put in for "Other Patient IDs" colliding with "Other 
Patient IDs Sequence" when CleanName drops the "Sequence". Should make a 
more general solution that "Sequence" is kept for any name collisions like 
this.


Original issue reported on code.google.com by [email protected] on 13 Feb 2009 at 2:32

Add dictionaries for private tags where possible

I think I saw some published dictionaries for private tags from some of the 
vendors -- e.g. Siemens, GE, Philips. "It would be nice" to have 
dictionaries available for such private tags. 

Needs a little thought since tag numbers could conflict between different 
vendors. May have to check the tags near start of dataset (e.g. 
Manufacturer (0008,0070)?) and attach only that vendor's private tags 
dictionary to the dataset instance somehow.


Original issue reported on code.google.com by [email protected] on 24 Jan 2009 at 4:04

Change package name to pydicom

It's considered bad practice for the library name and it's import name to 
be different -- it is confusing for users.

So, should change the import name to "pydicom", which would require:
* update all documentation to use "pydicom" rather than "dicom"
* update all example files
* ?possibly provide a converter tool to search and replace:
  * from dicom import --> from pydicom import
  * import dicom --> import pydicom
  * dicom. --> pydicom.



Original issue reported on code.google.com by [email protected] on 17 May 2009 at 6:12

Add 08 VR types

From DICOM standard 08_05 Table 6.2-1, need to add readers and writers for
the following:
  * OF - other float string
  * UT - unlimited text -- note multiple not allowed, backslash character
just text

Also see if can find files with these in them to test with.

Original issue reported on code.google.com by [email protected] on 15 Sep 2008 at 11:26

Write missing meta info if not found in read-in file

What steps will reproduce the problem?
1. Read a dicom file which is non-standard in not having file meta info
(preamble and group 2)
2. Write it out again.

Current code will also write without the meta info. Need to put in required
tags using pydicom's own Implementation Class UID, (optional) version, etc.
Group 2 elements [0, 1, 2, 3, 0x10, 0x12] are required by the DICOM standard.

Should also have a switch to put pydicom Implementation Class UID in even
if read-in file had proper meta info, as pydicom will have been the last to
process the file. 

Original issue reported on code.google.com by [email protected] on 1 Oct 2008 at 3:26

Expand allowable types for tag creation

Allow Tags to be created from lists (rather than just tuples) or perhaps 
any object which can "unpack" into two items:
group, elem = some_object

Implementation:
In tag.py, replace isinstance check for tuple to a try-except block using 
unpack line like above. Write unit tests in test_tag.py to at least add a 
list instance to the tests of constructing tag instances. Add tests to 
test_dataset.py testContains, at least one for a list like "[0x10,0x10] in 
ds".

Original issue reported on code.google.com by [email protected] on 28 May 2009 at 2:09

Delete data element by name

As outline in PydicomUserGuide, can delete a data element from a dataset using 
the tag. But should be able to do so using the name, just as for getting and 
setting DICOM data elements, e.g. del ds.PatientId

Steps:
* add __delattr__ method to Dataset in dataset.py:
(The code should be similar to that in __setattr__)
  * check if attribute already exists (i.e. is not a DICOM name), delete 
normally if it is. 
  * If not a normal attribute, then get tag by TagForName(name) and delete the 
tag from the dataset if it exists; if not, raise appropriate error 
(AttributeError)
* write unit tests -- need to test delete of attributes that exist and that 
attempt to del one that doesn't exist raises AttributeError
* modify example programs that delete data elements (anonymize.py for sure; 
others?) to use the new format with the name

Then I will need to also edit the deletion part of the PydicomUserGuide to 
show how to use the new method.


Original issue reported on code.google.com by [email protected] on 12 Jun 2009 at 2:26

Allow configurable printing

Let the user set visual preferences such as:
  * max width of tag name displayed
  * whether the VR is shown or not
  * whether UI's are shown as descriptive names (if available) or dotted
numbers
  * whether file position is shown at start of line
  * max depth of nested structures to show


Original issue reported on code.google.com by [email protected] on 21 Oct 2008 at 4:24

Add support for tab completion

Dataset does not give the best tab completion since dicom dataset
attributes are not actually object properties directly but are looked up.
See if can make tab completion (on ipython, perhaps others) work.

Original issue reported on code.google.com by [email protected] on 18 Dec 2008 at 5:47

Failure to write VR='US or SS or OW' properly

I ran into this problem while working with some new imagery.

With the attached imagery:
dcm = dicom.ReadFile( 'img3.dcm' )
dicom.WriteFile( 'img3out.dcm', dcm )

You receive "NotImplementedError: WriteDataElement: unknown Value 
Representation 'US or SS or OW'".

This error raises when trying to write the tag (0028, 3006) LUTData. 
Clearly the writing for this VR is not implemented, but easy to fix since 
US, SS and OW are all some binary 16 bit values (ss and us have VM of 2, 
where OW can be a large buffer of values).

Note: The following solution works for my needs under limited testing.

First, since US and SS both use write_OWvalue in filewriter.py, add 'US or 
SS or OW':write_OWvalue to the writers dictionary.

Now pydicom will most likely raise an error in the write_OWvalue method 
because it sees a list instead of a buffer of shorts.  This is because the 
DataElement constructor does not correctly capture the data for VR 'US or 
SS or OW'..  It treats the buffer as a free text type VR and splits on the 
text delimiter giving you a list of strings if the delimiter exists within 
your data..  To treat the data as binary, do the following:

in the DataElement Constructor:
under _setvalue(self,val)
if isString(val) and self.VR not in \
           ['UT','ST','LT', 'FL','FD','AT','OB','OW','OF','SL','SQ','SS',
            'UL','US', 'OW/OB', 'UN', ## ADD THIS ->## 'US or SS or OW']:

Now this should work:
dcm = dicom.ReadFile( 'img3.dcm' )
dicom.WriteFile( 'img3out.dcm', dcm )


Original issue reported on code.google.com by [email protected] on 24 Apr 2009 at 2:30

Attachments:

Pyglet connection or documentation

As suggested by brandon.forrester in issue35, could look into connection of 
pydicom to pyglet (http://www.pyglet.org/). It's a good fit with pydicom -- 
simple installation, very open (BSD) license.

This issue may not require much addition/modification of pydicom code -- 
perhaps documentation may be sufficient (could be added to 
WorkingWithPixelData page).

Original issue reported on code.google.com by [email protected] on 28 May 2009 at 2:18

Extend pydicom to earlier releases of python

1. The package fails to import on earlier versions of python (seen on 2.3.5
on Windows)
{{{
File "C:\Python23\Lib\site-packages\dicom\tag.py", line 28, in __new__
    raise OverflowError, "Tags are limited to 32-bit length"
OverflowError: Tags are limited to 32-bit length
}}}
2. setup.py script also uses package_data which python docs claim is new in
python 2.4. 

Original issue reported on code.google.com by [email protected] on 8 Sep 2008 at 3:09

Attribute -> DataElement

Rename Attribute to DataElement to more closely follow DICOM standards.
Attributes are what they are called in IODs, then Attributes are encoded
into Data Elements in actual DICOM files.


Original issue reported on code.google.com by [email protected] on 16 Oct 2008 at 10:45

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.