Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

### Added
- MRI previewer for NIFTY (.nii) files.

### Fixed
- Send email to all admins in a single email when a user submits 'Request access' for a space
- Send email to all admins and request user in a single email when any admin accepts/rejects 'Request access' for a space [#330](https://github.com/clowder-framework/clowder/issues/330)
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Following is a list of contributors in alphabetical order:
- Mike Lambert
- Nicholas Tenczar
- Nishant Nayudu
- Peter Groves
- Rob Kooper
- Rui Liu
- Sandeep Puthanveetil Satheesan
Expand Down
3 changes: 2 additions & 1 deletion conf/mimetypes.conf
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,5 @@ mimetype.nra=application/simsnra
mimetype.spe=application/simsspe
mimetype.Spe=application/simsspe
mimetype.xrdml=application/xray-xrdml
mimetype.xnra=application/simsxnra
mimetype.xnra=application/simsxnra
mimetype.nii=image/nii
37 changes: 37 additions & 0 deletions public/javascripts/previewers/mri-papaya/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#MRI previewer based on the Papaya JS library

## Papaya Library
Papaya is a javascript component for viewing MRI images. This integration only
currently supports NIFTI images (.nii and .nii.gz files).

Homepage: https://rii-mango.github.io/Papaya/
Live demo: https://papaya.greenant.net/
Source: https://github.com/rii-mango/Papaya

## Clowder Previewer

![Clowder MRI Previewer Screenshot](clowder-mri-papaya-screenshot.png)

TODO: Support for DICOM images is possible, but the integration is harder b/c
a single DICOM volume is a directory full of image files which must be queried
for through Clowder and then fed to the jquery component.

## Build

The assets in this previewer (clowder/public/javascripts/previewers/mri-papaya)
can be replicated with the following procedure. The BUILD_SHA below is from May 5, 2019, which
was the HEAD of the project's `master` branch as of April 15 2021.

Note that the `-nojquery` flag must be included or it will bundle a version of jquery that is
incompatible with Clowder's.

```
BUILD_SHA=782a19341af77a510d674c777b6da46afb8c65f1
git clone git@github.com:rii-mango/Papaya.git
cd Papaya
git checkout $BUILD_SHA
./papaya-builder.sh -nojquery
```

The assets will then be in the `build/` directory

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions public/javascripts/previewers/mri-papaya/mri-papaya.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
(function ($, Configuration) {

var scriptElem = document.createElement("script");
scriptElem.type = "text/javascript";
scriptElem.src = Configuration.previewer + "/papaya.js";
$(Configuration.tab).append(scriptElem);

var styleSheetLink = document.createElement("link");
styleSheetLink.rel = 'stylesheet';
styleSheetLink.href = Configuration.previewer + "/papaya.css";
$(Configuration.tab).append(styleSheetLink);

var params = [];
var papayaDivId = "papayaMain";
params['images'] = [Configuration.url];

//force the bottom control bar always on or the buttons will pop up in a weird place in the page
params['showControlBar'] = true;

//If you don't want the bottom controls, do this instead of showControlBar
//params['showControls'] = false;

var papayaDiv = document.createElement("div")
papayaDiv.setAttribute("id", papayaDivId);
$(Configuration.tab).append(papayaDiv);
papaya.Container.addViewer(papayaDivId, params);

}(jQuery, Configuration));


6 changes: 6 additions & 0 deletions public/javascripts/previewers/mri-papaya/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "interactive_mri_viewer_for_nii_files",
"main": "mri-papaya.js",
"file": true,
"contentType": ["image/nii", "application/x-gzip"]
}
1 change: 1 addition & 0 deletions public/javascripts/previewers/mri-papaya/papaya.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading