This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
h1. pfile-tools: GE P-File Utilities

This package provides a library refrence to GE's proprietary P-file format for their MR scanners. This is not a translation of their copyrighted header files, but a re-implementation. It's designed to let you catalog and anonymize your raw data, and hopefully provide enough information to run your own reconstruction.

In addition to the library, pfile-tools provides small scripts to display pfile header values and do an anomymization.

h2. Status

Header support is limited to stuff we've needed in-house or stuff that's really obvious. If you need something added, let me know.

Also, we currently only support reading revision 20 of the files. I suspect that it'll also effectively work on other revisions (particularly 22), but I don't know for sure which. Let me know!

h2. Installation

<pre>
$ easy_install pfile_tools
</pre>

(Or use pip if you're cool like that.)

h2. API Usage

<pre>
>>> from pfile_tools import headers
>>> pfile = headers.Pfile.from_file('/path/to/PXXXX.7')
>>> print(pfile.revision)
20
>>> print(pfile.header.exam_number)
5313
>>> print(pfile.header.exam_datetime)
datetime(2012, 3, 6, 10, 47, 42)
</pre>

Pfile.header is a Python "ctypes Structure":http://docs.python.org/library/ctypes.html#ctypes.Structure

h2. dump_pfile_header

Does what it says on the tin -- dumps a p-file's header to standard out, in a delimited (by default, tab-delimited) format.

<pre>
Usage: dump_pfile_header [OPTIONS] pfile

Dumps header information from a GE P-file

Options:
-h, --help show this help message and exit
-r REVISION, --revision=REVISION
Force a header revision (available: 20)
--offsets Show offsets to data elements
--sizes Show data element sizes
--show-padding Print unknown 'padding' elements
--separator=SEPARATOR
Output field separator (default: \t)
</pre>

h2. anonymize_pfile

Strips personally-identifying information from a p-file.

<pre>
Usage: anonymize_pfile.py [OPTIONS] pfile pfile_out

Removes personally-identifying information from a GE P-file

Options:
-h, --help show this help message and exit
-r REVISION, --revision=REVISION
Force a header revision (available: 20)
--inplace Edit file in-place. Ignores pfile_out.
-v, --verbose Print lots of extra debugging.

Anonymization options:
--name=yes/no Set patient name to 'ANONYMIZED' (yes)
--id=yes/no Set patient ID to 'ANONYMIZED' (yes)
--dateofbirth=yes/no
Set date of birth to '' (yes)
--age=yes/no Set age to 0 (yes)
--weight=yes/no Set weight to 0 (yes)
--sex=yes/no Set sex to 0 (yes)
</pre>

h2. License

pfile_tools is provided under the short-and-sweet BSD license. See LICENSE.txt for more information.

h2. Changes

h3. 0.3.0:

* Revamp, again, the version number detection code. It's the first *four* bytes, and it is indeed a float. Because, reasons. Fie on Python for its automatic conversion of floats to doubles. FIE. ON. YOU.
* Add support for revision 16 files.

h3. 0.2.0:

* Detect version number differently -- now we're interpreting the first four bytes as a short representing version number, as opposed to using the first eight bytes as a float, which always seemed really strange anyhow. The downside is that the numbers don't seem to be what anyone calls the software revision. Sigh. Anyhow, this also handles pfiles written by the newest and greatest GE software; there were a couple of 8-byte padding shifts.

h3. 0.1.3:

* Started tracking changes. This version worked, more or less.
Release History

Release History

0.3.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1dev2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1dev

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pfile-tools-0.3.1.tar.gz (12.9 kB) Copy SHA256 Checksum SHA256 Source Nov 3, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting