Giter Club home page Giter Club logo

murfi2's Introduction

MURFI (multivariate and univariate real-time functional imaging) is a software package for real-time processing of functional brain images for neuroscience applications. At the moment murfi is fMRI-centric, but we plan to add support for other imaging modalities.

This is an open-source release of the MURFI platform (see LICENSE for details).

For using MURFI with Siemens scanners, a proprietary data transfer sequence can be obtained via a C2P agreement. Alternatively, for non-Siemens scanners or for your own Siemens functors, Murfi will accept data over TCPIP conformant with the following structured information:

https://github.com/gablab/murfi2/blob/master/src/io/RtExternalSenderImageInfo.h

If you use MURFI in your own research, please cite:

Oliver Hinds, Satrajit Ghosh, Todd W Thompson, Julie J Yoo, Susan Whitfield-Gabrieli, Christina Triantafyllou, John D E Gabrieli (2011) Computing moment-to-moment BOLD activation for real-time neurofeedback. Neuroimage 54: 1. 361-368 Jan

http://dx.doi.org/10.1016/j.neuroimage.2010.07.060

Quickstart

Install murfi from a pre-built docker image:

sudo singularity build -F murfi.sif docker://ohinds/murfi:latest

This command will take some time, as it downloads a pre-built murfi docker image from dockerhub, then builds a singularity image (murfi.sif) from the docker image.

Running the example

mkdir murfi_example_data && \
    cd murfi_example_data && \
    curl -fsSL https://www.dropbox.com/s/1vvrz2g4tbzoh5c/murfi_example_data.tgz | tar -xz --strip-components 1
MURFI_SUBJECTS_DIR=.. MURFI_SUBJECT_NAME=murfi_example_data singularity exec ../murfi.sif murfi -f scripts/neurofeedback.xml

In another terminal:

cd murfi_example_data/scripts
singularity exec ../../murfi.sif ./servedata.sh 3000 15000 $(hostname)

Development

Dependencies:

  1. libace
  2. freeglut
  3. libgsl
  4. vxl
  5. qt5
  6. libniftiio

On recent Ubuntu distros, the following command will install all dependencies except vxl:

sudo apt-get install \
    build-essential \
    curl \
    cmake \
    libace-dev \
    libgsl-dev \
    libnifti-dev \
    libboost-filesystem-dev \
    qtbase5-dev \
    qtchooser \
    qt5-qmake \
    qtbase5-dev-tools \
    libqt5opengl5-dev

To install vxl, use the following commands:

curl -fsSL https://github.com/vxl/vxl/archive/v3.5.0.tar.gz | tar xz --strip-components 1 \
    && mkdir build \
    && cd build \
    && cmake -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr .. \
    && make -j 4 \
    && sudo make install \
    && rm -rf build \
    && ln -s /usr/include/vxlinclude/vxlcoreinclude/vxlvnl/ /usr/include/vxlinclude/vxlcoreinclude/vnl

Compilation:

cd <path to toplevel murfi directory>
make -j$(nproc)

Installation (optional):

sudo ln -sf bin/murfi /usr/bin

Funding

This project was partially funded by several sponsors:

  • DARPA
  • NIH
  • McGovern Institute Neurotechnology Development Grant

murfi2's People

Contributors

akeshavan avatar ohinds avatar pwighton avatar sasen avatar satra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

murfi2's Issues

license compatibility

@ohinds - we need to ensure that all dependent libraries are either BSD/MIT/Apache for murfi2 to be released as apache. i see that we are linking to gsl, which would prevent murfi2 from being released under apache v2.

roi values - why two?

for every mask murfi appears to return two values for each TR. what are these two values?

config file minimal requirements

the qt branch minimal config file is not minimal.

the xml file needs a few more things amongst others:

disabled=false
port number
receiveimages=true

also, the config file requires the subject info for murfi to load it, even if environment variables are set.

Path to QColor

The call to QColor in the PlotController.h file during installation doesn't work... I have the latest Qt update, and the QColor file is in /usr/include/x86_64-linux-gnu/qt5/QtGui. Compiler says there is no QColor file or directory...

Using servenii to send data

Hey,

I am trying to use servenii to send nifti files to a vagrant box running murfi to visualize fMRI data to test the real time analysis. The issue we are having now is that the data in the murfi window looks scrambled. When the nifti file is opened with fsleyes, the labels are also incorrect. Is this a problem with the real time fMRI ICE Configurator sending data to the computer, or is the issue with servenii?

Thanks in advance,
Arun Venkataraman

new open header erroring

i was testing the open header with andre today at mit. and was running into this error. didn't have time to debug.

received info
processing 616 header data bytes
header received: TR=10
Requires: 294912 bytes
ExternalImageHeader(magic='ERTI', headerVersion=4, seriesUID='1.3.12.2.1107.5.2.32.35115.2013081322103941796402114', scanType='EPI', imageType='3D', note='Initial OpenHeader Implementation. repetitionDelayMS is currently hard-coded to 0', dataType='int16_t', isLittleEndian=True, isMosaic=True, pixelSpacingReadMM=3.28125, pixelSpacingPhaseMM=3.28125, pixelSpacingSliceMM=4.0, sliceGapMM=1.0, numPixelsRead=64, numPixelsPhase=64, numSlices=30, voxelToWorldMatrix=[-3.28125, 0.0, 0.0, 105.0, 0.0, -3.28125, 0.0, 105.0, 0.0, 0.0, 5.0, -72.5, 0.0, 0.0, 0.0, 1.0], repetitionTimeMS=2000, repetitionDelayMS=0, currentTR=10, totalTR=10, isMotionCorrected=True, mcOrder='TZYX', mcTranslationXMM=-0.0094293402949011, mcTranslationYMM=0.0008725363597534, mcTranslationZMM=0.014861163666259001, mcRotationXRAD=-0.0048493300566949, mcRotationYRAD=0.0055316874022655, mcRotationZRAD=-0.000439865096032)
----------------------------------------
Exception happened during processing of request from ('192.168.2.3', 54797)
Traceback (most recent call last):
  File "/software/anaconda/envs/devpype/lib/python2.7/SocketServer.py", line 593, in process_request_thread
    self.finish_request(request, client_address)
  File "/software/anaconda/envs/devpype/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "receive_nii.py", line 35, in createHandler
    return ThreadedTCPRequestHandler(callback, infoclient,  *args, **keys)
  File "receive_nii.py", line 23, in __init__
    SocketServer.BaseRequestHandler.__init__(self, *args, **keys)
  File "/software/anaconda/envs/devpype/lib/python2.7/SocketServer.py", line 649, in __init__
    self.handle()
  File "receive_nii.py", line 26, in handle
    self.callback(self.infoclient, self.request)
  File "receive_nii.py", line 40, in process_data_callback
    infoclient.process_data(sock)
  File "receive_nii.py", line 126, in process_data
    (self.ei.get_image_size(), len(img_data))
ValueError: Image data wrong size: expected 294912 bytes, got 8688

also for some reason hdr.seriesUID is changing in subsequent TRs

ExternalImageHeader(magic='ERTI', headerVersion=4, seriesUID='1.3.12.2.1107.5.2.32.35115.2013081322103941796402114', scanType='EPI', imageType='3D', note='Initial OpenHeader Implementation. repetitionDelayMS is currently hard-coded to 0', dataType='int16_t', isLittleEndian=True, isMosaic=True, pixelSpacingReadMM=3.28125, pixelSpacingPhaseMM=3.28125, pixelSpacingSliceMM=4.0, sliceGapMM=1.0, numPixelsRead=64, numPixelsPhase=64, numSlices=30, voxelToWorldMatrix=[-3.28125, 0.0, 0.0, 105.0, 0.0, -3.28125, 0.0, 105.0, 0.0, 0.0, 5.0, -72.5, 0.0, 0.0, 0.0, 1.0], repetitionTimeMS=2000, repetitionDelayMS=0, currentTR=7, totalTR=10, isMotionCorrected=True, mcOrder='TZYX', mcTranslationXMM=0.0042315309944431, mcTranslationYMM=-0.0025443566414593, mcTranslationZMM=0.0071906872163449, mcRotationXRAD=-0.0025820459857879, mcRotationYRAD=-0.0049068081238989, mcRotationZRAD=0.0008466105930182)
----------------------------------------
received info
processing 616 header data bytes
header received: TR=8
Requires: 294912 bytes
ExternalImageHeader(magic='ERTI', headerVersion=4, seriesUID='1.3.12.2.1107.5.2.32.35115.2013081322103945048702115', scanType='EPI', imageType='3D', note='Initial OpenHeader Implementation. repetitionDelayMS is currently hard-coded to 0', dataType='int16_t', isLittleEndian=True, isMosaic=True, pixelSpacingReadMM=3.28125, pixelSpacingPhaseMM=3.28125, pixelSpacingSliceMM=4.0, sliceGapMM=1.0, numPixelsRead=64, numPixelsPhase=64, numSlices=30, voxelToWorldMatrix=[-3.28125, 0.0, 0.0, 105.0, 0.0, -3.28125, 0.0, 105.0, 0.0, 0.0, 5.0, -72.5, 0.0, 0.0, 0.0, 1.0], repetitionTimeMS=2000, repetitionDelayMS=0, currentTR=8, totalTR=10, isMotionCorrected=False, mcOrder='TZYX', mcTranslationXMM=0.0, mcTranslationYMM=0.0, mcTranslationZMM=0.0, mcRotationXRAD=0.0, mcRotationYRAD=0.0, mcRotationZRAD=0.0)

so this breaks the assert.

servenii: command not found

Hi Satra,

I installed murfi afresh on a new laptop but am getting

servenii: command not found

when trying to run the `./servedata.sh' script

difference of ROIs

is there a way to implement a difference of roi value calculation? when one roi is background/wm it's variance could be low and hence z value can be really high. subtracting z values makes sense only if one is comparing task related rois.

in the other cases, one might want to z-ify the difference in activity between two mask regions.

Create Separate Logs for Each Run

It would be useful if murfi could output separate logs each time it is run rather than append one after the other in a single log.

servenii and servenii4d

with the current qtmurfi minimal configuration modifed to save images:

  1. servenii not sending appropriate data information - murfi doesn't show a mosaic
  2. servenii4d works as in murfi shows a mosaic and the rois on it

in neither case above does murfi save the data with proper voxel information - i believe this is an issue with the two scripts above rather than murfi as murfi saves data from the scanner properly.

with servenii, it does this:

$ mri_info img-00020-00001.nii 
Volume information for img-00020-00001.nii
          type: nii
    dimensions: 12 x 12 x 31
   voxel sizes: 3.0000, 3.0000, 3.6000

with servenii4d it does this:

$ mri_info img/img-00021-00001.nii 
WARNING: MRIsetRas2VoxFromMatrix(): voxels sizes are inconsistent
   (0,1.00007) (0,1.01065) (3.6,0.992484) 
This is probably due to shear in the vox2ras matrix

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.