Papaya viewer extension for CKAN
Project description
ckanext-papaya
This is an extension for CKAN that uses Papaya (https://github.com/rii-mango/Papaya) to provide views for NIFTI (.nii) and DICOM (.dcm) file formats. It provides views for both single DICOM files as well as DICOM directories uploaded to CKAN as a ZIP file.
Requirements
Tested with CKAN 2.9.0a.
Installation
To install ckanext-papaya:
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
Install the ckanext-papaya Python package into your virtual environment:
pip install ckanext-papaya
Add papaya to the ckan.plugins setting in your CKAN config file (by default the config file is located at /etc/ckan/default/production.ini). To avoid having the Papaya viewer enabled for all ZIP files, regardless of whether they contain DICOM files, do not add papaya to ckan.views.default_views.
Restart CKAN. For example if you’ve deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
Config settings
None at present. NIFTI files and DICOM directories tend to be rather large, so you may have to increase the maximum resource size to allow users to upload these file formats.
Developer installation
To install ckanext-papaya for development, activate your CKAN virtualenv and do:
git clone https://github.com//ckanext-papaya.git cd ckanext-papaya python setup.py develop pip install -r dev-requirements.txt
Tests
To run the tests, do:
nosetests --nologcapture --with-pylons=test.ini
To run the tests and produce a coverage report, first make sure you have coverage installed in your virtualenv (pip install coverage) then run:
nosetests --nologcapture --with-pylons=test.ini --with-coverage --cover-package=ckanext.papaya --cover-inclusive --cover-erase --cover-tests
Using the Extension
The extension automatically creates a view using the Papaya Viewer for single DICOM files (with file extension .dcm), NIFTI files (with file extension .nii), and ZIP archives that contain one or more DICOM files. If a ZIP archive contains other file types besides DICOM files, or DICOM files without the .dcm extension, they will simply be ignored when displaying correctly-formatted files in Papaya.
To view zipped DICOM files, the extension temporarily unzips the archive and passes the contents of the files with .dcm extensions to Papaya. The unzipped files are deleted immediately to prevent them from taking up space on the server. Papaya can’t actually read local files, since it’s a JavaScript framework, so it is necessary to pass the raw contents of the files rather than the paths to the files themselves on to Papaya. Users may experience some lag when trying to view large DICOM directories, but most of this lag comes from Papaya reading the individual DICOM files rather than from the CKAN extension passing the data to Papaya.
Unlike our ParaView extension (https://github.com/SFB-ELAINE/ckanext-paraview), this extension runs directly in CKAN and does not require a separate server. Once it is installed in a CKAN instance and added to the config file, it will work without further setup.
This extension will automatically create Papaya views for newly-uploaded files, but existing resources with NIFTI files, single DICOM files, or DICOM directories may need to have the Papaya view added manually.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file ckanext-papaya-0.0.1.tar.gz
.
File metadata
- Download URL: ckanext-papaya-0.0.1.tar.gz
- Upload date:
- Size: 444.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/2.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dd63e93812885f0807a91031b9bfd0e8167ba2196958fcaeba73d3772956a66 |
|
MD5 | 8ebe1b4fda51bb215f0deaad9312d8c2 |
|
BLAKE2b-256 | 4790e3d26b8b0626acd655d58c3e74dd3afe44380f6bf562e912ca2dd61e6711 |