Code Monkey home page Code Monkey logo

brkraw's Introduction

DOI made-with-python Binder

BrkRaw: A comprehensive tool to access raw Bruker Biospin MRI data

Version: 0.3.11

Description

The ‘BrkRaw’ is a python module designed to provide a comprehensive tool to access raw data acquired from Bruker Biospin preclinical MRI scanner. This module is also compatible with the zip compressed data to enable use of the archived data directly.
The module is comprised of four components, including graphical user interface (GUI), command-line tools, high-level and low-level python APIs.

  • For the GUI, we focused on improving convenience for checking metadata and previewing the reconstructed image.
  • For the command-line tool, we focused on providing tools for converting, organizing, archiving, and managing data. The command-line tool also provides easy-to-use function to convert large set of raw data into organized structure according to BIDS.
  • For the high-level python API, we focused on enhancing the accessibility of reconstructed image data with preserved image orientation and metadata for the image analysis. It compatible users' convenient objects type (nibabel or SimpleITK) without the conversion step.
  • For the low-level python API, we focused on providing a consistent method to access raw Bruker data including parameter and binary files with the python compatible datatype while keeping the sake of simplicity.

Conversion reliability

Robust Orientation We've tested our converter using the sample dataset from Bruker2Nifti_QA and the results showed correct geometry and orientation for all datasets. We are still looking for more datasets showing orientation issue, if you have any shareable dataset, please contact the developer.

Website

For more detail information including installation, usage and examples, please visit our GitPage.

Credits:

Authors
  • SungHo Lee ([email protected]): main developer
  • Woomi Ban ([email protected]): sub-developer who tested and refined the module structure
  • Jaiden Dumas: proofreading of documents and update contents for the user community.
  • Dr. Gabriel A. Devenyi: The vast contributions to refinement of module functionality and troubleshooting.
  • Yen-Yu Ian Shih ([email protected]): technical and academical advisory on this project (as well as funding)
Contributors
  • Drs. Chris Rorden and Sebastiano Ferraris: The pioneers related this project who had been inspired the developer through their great tools including dcm2niix and bruker2nifti, as well as their comments to improve this project.
  • Dr. Mikael Naveau: The publisher of bruker2nifti_qa, the set of data to help benchmark testing of Bruker converter.

License:

GNU General Public License v3.0

How to get Support

If you are experiencing any problem or have questions, please report it through Issues

Citing BrkRaw

Lee, Sung-Ho, Ban, Woomi, & Shih, Yen-Yu Ian. (2020, June 4). BrkRaw/bruker: BrkRaw v0.3.3 (Version 0.3.3). Zenodo. http://doi.org/10.5281/zenodo.3877179

BibTeX

@software{lee_sung_ho_2020_3907018,
  author       = {Lee, Sung-Ho and
                  Ban, Woomi and
                  Shih, Yen-Yu Ian},
  title        = {BrkRaw/bruker: BrkRaw v0.3.4},
  month        = jun,
  year         = 2020,
  publisher    = {Zenodo},
  version      = {0.3.4},
  doi          = {10.5281/zenodo.3907018},
  url          = {https://doi.org/10.5281/zenodo.3907018}
}

brkraw's People

Contributors

banwoomi avatar dependabot[bot] avatar dvm-shlee avatar eugenegkim avatar gdevenyi avatar grandjeanlab avatar jeremie-fouquet avatar jsmi-d avatar lconcha avatar mih avatar remi-gau avatar ricardorios46 avatar timwahoo avatar ycabout avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

brkraw's Issues

Naming convention of output file using brkraw tonii

Hey! I am trying to use brkraw to convert my raw files to nifti.
Unfortunately, within my subject file the values for SubjectID, SessionID and StudyID seem to be weirdly assigned. I am now modyfining those values so that the output after conversion is named clearly and correctly. As far as I understand the files coming from the conversion (when using brkraw tonii) are named according to what is written in the subject-file of each scan. Could you tell me which values are used to form the name of the output file?
Thank you for your help!

Error in running command-line commands

This could be a very basic Python question, as I don't know very well about Python, but whenever I run the command-line commands I got an error message of some sort.
For example, below is the error message I get when I run "brkraw info":
image

Also, the "brkraw gui" opens the GUI, but when I try to convert a scan, it gives out an error like below:
image

If anyone could help me with this, I would greatly appreciate.

Thanks,
Soo Hyun

review comments based on JOSS submissin

Hello everyone,

my name is Peer and I'm one of the reviewers of the manuscript you've submitted to JOSS regarding this repository and tool.

Based on my first round of review, I would like to provide some feedback regarding the review points I did not checked and I think need just a little more work to bring this already great manuscript home. The respective points will be outlined below. If you have the impression that my feedback is not constructive, my wording to harsh, I misunderstood something and/or have any other questions, please let me know.

Documentation

  • the statement of need could be more precisely outlined and described on the landing page following JOSS guidelines: "...what problems the software is designed to solve and who the target audience is?"
  • while there's already information regarding different use cases and functionality, the respective parts could/should be demonstrated on data: a step-step walkthrough would be great, converting real world example data
  • regarding the API: I checked your respective jupyter notebook and would like to suggest to add more information and description to this notebook, explaining things a bit more in depth. Furthermore, you could think about adding this notebook in an interactive version (through the amazing binder project) via a badge to your documentation.

Software

  • While I know that your software is not "classic" when it comes to automated tests, I think adding some would be great in order to ensure functionality in the future. Maybe certain parts of the API could be tested, that is if data is converted as expected?

Repository and Community

  • It would be great if you could include resources that make it easier for the community to interact with you as developers. This could/should entail an Issue template, Contributing guidelines and information regarding where to get support.

General

  • The writing of the paper could be improved (a few missing words/articles here and there, present/past, etc.).
  • The Naveau:2019 reference is not correctly rendered. Could you please check if that's maybe a typo in your submission or a problem on JOSS' end?

Again, if you have any questions regarding my comments, please don't hesitate to let me know. If you consider addressing them, I think it would be great to submit one PR for each comment to ensure traceability during the review process and beyond. I would like to thank you again for submitting this interesting manuscript.

I hope you and your loved ones are doing ok in these difficult times.

Best regards, Peer

Push the 0.3.4 release to PyPI

The current git hub release version is 0.3.4, however, the python pip version is still 0.3.3. It would be nice to push the latest release to pip.

brkraw gui fails to convert if "SetOutput" is not pressed first

$ brkraw gui
Exception in Tkinter callback
Traceback (most recent call last):
  File "/home/gdevenyi/miniforge3/lib/python3.7/tkinter/__init__.py", line 1705, in __call__
    return self.func(*args)
  File "/home/gdevenyi/miniforge3/lib/python3.7/site-packages/brkraw/ui/main_win.py", line 185, in _save_as
    self._raw.save_as(self._scan_id, self._reco_id, filename, dir=self._output)
  File "/home/gdevenyi/miniforge3/lib/python3.7/site-packages/brkraw/lib/loader.py", line 402, in save_nifti
    output_path = os.path.join(dir, '{}.{}'.format(filename, ext))
  File "/home/gdevenyi/miniforge3/lib/python3.7/posixpath.py", line 80, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

Either SetOutput should be grayed out, or the output directory should default to the runtime directory of brkraw

docker version of brkraw

I recently has put a couple issues. I currently work with Dr. Gabriel A. Devenyi @gdevenyi on a project that potentially involves brkraw bids converter.
I think a docker version of brkraw would be helpful, given that someone don't have to worry about dependency conflict with other project (or as an alternative to python venv).
I made a simple docker version:
https://hub.docker.com/r/ycabout/brkraw
Feel free to ignore this.

output diffusion gradients

Thanks for such an amazing tool.

Can brkraw output diffusion gradient directions and b values (bvals, bvecs)? I cannot find any information on the documentation.

3D FLASH T1w slope

Hi again,

This is another issue that drove us crazy when using DICOMS. Seems the intensity range in the Bruker 3D FLASH T1w is from 0-1. We usually just removed the 2 first lines in the following DICOM header options to fix it:

0028 1052        2 [1870    ] //          IMG Rescale Intercept//0 
0028 1053       16 [1880    ] //              IMG Rescale Slope//0.0001033734821 
0028 1054        2 [1904    ] //               IMG Rescale Type//US

This is also true for the GRE-EPI data:

0028 1052        2 [1834    ] //          IMG Rescale Intercept//0 
0028 1053       12 [1844    ] //              IMG Rescale Slope//0.0073491817
0028 1054        2 [1864    ] //               IMG Rescale Type//US

Is there a way to Convert the file with the full range?

Thank you,

Eduardo

Review Comments JOSS, Reviewer Martin Wegrzyn

Dear @dvm-shlee et al.,

my name is Martin Wegrzyn and I am one of the reviewers assigned to your submission to JOSS. Thank you for your work on BrkRaw. The following are some comments I have regarding my first impression of the package and the manuscript:

code & examples

  • I tried to run the notebook examples/BrkRaw_PythonAPI.ipynb but got a number of error messages and some inconsistencies with the outputs of the notebook you uploaded.
  • Cell 8: Error: “AttributeError: module 'brkraw.lib.reference' has no attribute 'METADATA_FILED_INFO'”
  • Cells 15, 20 “AttributeError: 'NoneType' object has no attribute 'T'”
  • Cell 37: “TypeError: get_dataobj() got an unexpected keyword argument 'slp_correct'”
  • Cell 39 (and others) different output than the one on GitHub: e.g. your affine matrix is
[[  0.4    -0.      0.004 -14.381]
 [ -0.     -0.4     0.     14.968]
 [ -0.004   0.      0.4     1.824]
 [  0.      0.      0.      1.   ]]

mine, when running the code, is

[[-0.399978	-0.000000	-0.004234	14.381493]
 [0.000000	-0.400000	-0.000000	14.968180]
 [0.004234	0.000000	-0.399978	-1.824436]
 [0.000000	0.000000	0.000000	1.000000]]

Hence, there are some changes in the signs (last column). Could this be a problem e.g. with left-right flips of the data?

compare: https://gist.github.com/mwegrzyn/1c8113631a4ab3fe19cf1838f3356b56

  • regarding the example data, I wanted to ask whether there would be a possibility for me to confirm where left and right is in the image?

  • also regarding the example data, the BOLD/EPI images seem to be 3D-files (single volume), not 4D timeseries; is this correct or should I be able to see different volumes? I think it would be useful to have 4D files for testing purposes. Thank you!

  • the BIDS-conversion worked very well, however, it only worked for me if I did not use the .json file and only used the .xlsx file. The command

brkraw bids_convert 20190724_114946_BRKRAW_1_1 dataset_description.xlsx -r dataset_description.json

did not work:

brkraw: error: unrecognized arguments: -r dataset_description.json”

only using

brkraw bids_convert 20190724_114946_BRKRAW_1_1 dataset_description.xlsx”

did work fine!

Manuscript

  • regarding the motivation of the project, when reading the manuscript I get the feeling that you argue that nifiti-conversion is useful; also, your package has the ability to convert to nifti; on the other hand, the companion website mentions that nifiti conversion is a "legacy" function. Hence, I am unsure what the nature of "BrkRaw" is and how much the “raw” handling of the data is desirable from your point of view. E.g. “The module has been built up upon robust low-level Python Application Programming Interface (API), allowing direct raw data access without conversion to provide the advanced and easy-to-use features for data analysis.”; here, I would like to learn more about the analysis on raw data mentioned and why Nifiti conversion is nevertheless such a central part of the package. Thank you.

  • I think it is fair to say that the manuscript would need proofreading. Also, there are some sentences where the meaning is a bit unclear. For example at the end of 1st paragraph: “However, the preclinical MRI research using laboratory animals or objects does not require the DICOM conversion step and is rather inefficient.” > this sounds like preclinical MRI is inefficient, while I assume that the intended meaning is that the DICOM conversion step would be inefficient for preclinical MRI?

  • Figures: Overall, I found the figures difficult to understand. Maybe more extensive figure legends or in-text descriptions could be helpful (although I saw in other JOSS papers, that figure descriptions are often as brief as yours. Still, it might be worth considering)

  • Figure 1: Could you explain what we see in the “between dataset comparison” and how we can visually assess successful conversion?

  • Figure 4: the contents of the four subplots are not readable. I would be great if you could increase the resolution of the figure. Thank you.

I hope you find these comments to be helpful. Please let me know if you have any questions regarding the points I raised. Thank you for your time and consideration.

Best regards,
Martin Wegrzyn

documentation for --recoid and --scanid unclear

Typically, I would except to be able to extract single scan by some sort of number in the scan order:

$ brkraw info raw
Paravision 5.1
--------------
UserAccount:    galdan
Date:           2020-01-31
Researcher:     MCH_DEV_PHT_001
Subject ID:     20200131_MCH_DEV_PHT_001
Session ID:     dev
Study ID:       1
Date of Birth:  None
Sex:            male
Weight:         5 kg
Subject Type:   Human
Position:       Supine          Entry:  HeadFirst

[ScanID]        Sequence::Protocol::[Parameters]
[001]   FLASH (pvm)::01-TriPilot-multi::
        [ TR: 200 ms, TE: 3 ms, pixelBW: 500.80 Hz, FlipAngle: 30 degree]
    [01] dim: 2D, matrix_size: 256 x 256 x 15, fov_size: 40 x 40 (unit:mm)
         spatial_resol: 0.156 x 0.156 x 1.000 (unit:mm), temporal_resol: 25600.000 (unit:msec)
[002]   FLASH (pvm)::exvivoDanFLASH::
        [ TR: 21.47 ms, TE: 5.11 ms, pixelBW: 96.90 Hz, FlipAngle: 20 degree]
    [01] dim: 3D, matrix_size: 228 x 258 x 130, fov_size: 15.96 x 18.06 x 9.1 (unit:mm)
         spatial_resol: 0.070 x 0.070 x 0.070 (unit:mm), temporal_resol: 1920266.000 (unit:msec)

$ $ brkraw tonii --scanid 1 raw
[Warning]::'1'

I don't know what --recoid and --scanid refer to?

[Configuration] configurable replacement on underscore and hyphen in participant ID and session ID

@gdevenyi gets full credit of this feature request.

General speaking, underscore ("") and hyphen ("") should be avoided in participant ID and session ID in your datasets if you are considering converting to bids format. However, in reality, there is some cases that do contain underscore and hyphen in participant ID and session ID.
brkraw bids_concert replaces those character with "Underscore" and "Hyphen", but make the replacement configurable would be better.

brkraw bids converter does not work well with zipped files.

brkraw bids converter does not work well with zipped files.
On official website:
Simply put all raw Bruker data (or zipped) into a folder and run ‘brkraw bids_helper’ command

Used sample data provided named bruker2nifti_qa-master.zip, in project readme,

  1. If supply the zip file directly, bids_helper produced error:
    NotADirectoryError: [Errno 20] Not a directory: '/data/zipped/bruker2nifti_qa-master.zip'
  2. If supply the parent folder, bids_helper works but produce a blank .xlsx file, which makes the next step bids converter not converting images.

Trying to reconstruct non-existant "recoid" doesn't give helpful error

$ brkraw --version
brkraw v0.3.3rc5

$ brkraw info raw
Paravision 5.1
--------------
UserAccount:    galdan
Date:           2020-01-31
Researcher:     MCH_DEV_PHT_001
Subject ID:     20200131_MCH_DEV_PHT_001
Session ID:     dev
Study ID:       1
Date of Birth:  None
Sex:            male
Weight:         5 kg
Subject Type:   Human
Position:       Supine          Entry:  HeadFirst

[ScanID]        Sequence::Protocol::[Parameters]
[001]   FLASH (pvm)::01-TriPilot-multi::
        [ TR: 200 ms, TE: 3 ms, pixelBW: 500.80 Hz, FlipAngle: 30 degree]
    [01] dim: 2D, matrix_size: 256 x 256 x 15, fov_size: 40 x 40 (unit:mm)
         spatial_resol: 0.156 x 0.156 x 1.000 (unit:mm), temporal_resol: 25600.000 (unit:msec)
[002]   FLASH (pvm)::exvivoDanFLASH::
        [ TR: 21.47 ms, TE: 5.11 ms, pixelBW: 96.90 Hz, FlipAngle: 20 degree]
    [01] dim: 3D, matrix_size: 228 x 258 x 130, fov_size: 15.96 x 18.06 x 9.1 (unit:mm)
         spatial_resol: 0.070 x 0.070 x 0.070 (unit:mm), temporal_resol: 1920266.000 (unit:msec)

$ brkraw tonii --recoid 002 --scanid 001 raw
[Warning]::'NoneType' object has no attribute 'parameters

bids_convert crashing

Hi!

I'm testing the bids_convert with my data.

First I ran the bids_helper to create the XLSX and JSON files.

Then I edited the xlsx file, by changing the SessID completely, and adding some missing data such as modality and task.
Here is the JSON

Then I ran:

brkraw bids_convert -j Model20p_bids.json -o Model20p_bids --ignore-rescale Model20p Model20p_bids.xlsx

I get this error crash:

Traceback (most recent call last):
  File "/home/egarza/.local/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2646, in get_loc
    return self._engine.get_loc(key)
  File "pandas/_libs/index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'SessID'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/egarza/.local/bin/brkraw", line 11, in <module>
    load_entry_point('bruker==0.3.3', 'console_scripts', 'brkraw')()
  File "/home/egarza/.local/lib/python3.6/site-packages/brkraw/scripts/brkraw.py", line 362, in main
    if all(pd.isnull(df['SessID'])):
  File "/home/egarza/.local/lib/python3.6/site-packages/pandas/core/frame.py", line 2800, in __getitem__
    indexer = self.columns.get_loc(key)
  File "/home/egarza/.local/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2648, in get_loc
    return self._engine.get_loc(self._maybe_cast_indexer(key))
  File "pandas/_libs/index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'SessID'

Thanks,

Eduardo

Could SimpleITK become an optional dependency?

Hey, this issue is part of my review of your JOSS submission at openjournals/joss-reviews#2277

SimpleITK is a quite heavy (>40MB) and needs to be compiled (in contrast to the pure Python NiBabel). Moreover, it is only used in a single location lib/loader.py:get_sitkimg() via an internal import.

Could this be made an optional dependency and safe non-ITK users the potential complications?

Contribute low-level code to NiBabel?

Hey, this issue is part of my review of your JOSS submission at openjournals/joss-reviews#2277

This package provides valuable functionality that is not available in NiBabel. However, NiBabel, arguably, is the key package for neuroimaging file format support in the Python ecosystem. It has more than 80 contributors so far, and a solid track record for keeping essential data IO procedures alive and well for a long period of time. Given that much academic software shares the lifecycle of PhD students, I consider it important to integrate as much code as possible in community-maintained projects to improve the overall resilience of the research software ecosystem.

BrkRaw's scope is clearly wider than what would be a suitable contribution for NiBabel. However, NiBabel is already a dependency, so moving low-level code into this core library would not complicate deployment for BrkRaw users.

Did you consider such a contribution?

bruker 0.3.6 no longer on pip?

Describe the bug
~2 months ago, pip insall bruker would install 0.3.6
Today, only 0.3.3 is available.

Contrary to 0.3.6 , the currently available version doesn't attribute axis orientation correctly for head-first prone mice that were labelled on scan card as being 'supine' (AKA: the trick).

To Reproduce
conda create --name bruker pip
source activate bruker
pip install bruker
pip list | grep bruker

Current output (12-02-2021:
bruker 0.3.3

Expected behavior
On my build (late 2020):
bruker 0.3.6

Screenshots
NA

Desktop (please complete the following information):

  • OS: CentOS Linux 7 (Core)
  • Python 3.7.9
  • pip 20.3.3

Additional context
Add any other context about the problem here.

PV5 only allows Human as subject type

After a careful auditing of the software, PV5 will only ever allow Human subject type, thus, I think we need to do two things

  1. Decide on the assumed subject type (Quadruped I suggest)
  2. Print a warning about 1.
  3. Provide a way to override subject type

tonii_all crashes if run against a bruker study directory

Works fine if I run it properly on the parent directory, however crashes if I run against a single study (I know this is not the right way to do it, but it shouldn't crash)

$ brkraw tonii_all 20200707_CIC_PLANTEST_007.321/
Traceback (most recent call last):
  File "/home/gdevenyi/miniforge3/bin/brkraw", line 8, in <module>
    sys.exit(main())
  File "/home/gdevenyi/miniforge3/lib/python3.7/site-packages/brkraw/scripts/brkraw.py", line 210, in main
    study = BrukerLoader(sub_path)
  File "/home/gdevenyi/miniforge3/lib/python3.7/site-packages/brkraw/lib/loader.py", line 89, in __init__
    self._pvobj = load(path)
  File "/home/gdevenyi/miniforge3/lib/python3.7/site-packages/brkraw/lib/loader.py", line 17, in load
    return PvDatasetDir(path)
  File "/home/gdevenyi/miniforge3/lib/python3.7/site-packages/brkraw/lib/pvobj.py", line 145, in __init__
    self._parse_info()
  File "/home/gdevenyi/miniforge3/lib/python3.7/site-packages/brkraw/lib/pvobj.py", line 160, in _parse_info
    if len(root.split(os.sep)) == root_path_fregs + 1:
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

Installation error

I got
ERROR: Could not find a version that satisfies the requirement shleeh>=0.0.4 (from bruker==0.3.2rc0) (from versions: 0.0.1.dev1)
ERROR: No matching distribution found for shleeh>=0.0.4 (from bruker==0.3.2rc0)
when I run
pip install bruker
OR
pip install git+https://github.com/dvm-shlee/bruker

PV6 VisuSubjectType is not used to provide proper orientation in combination with VisuSubjectPosition

In the case of PV6, there are several options for input subject type:
image

When combined with VisuSubjectPosition, these need to properly orient the scan in standardized coordinates.

Take for example a primate in "Head First Supine" vs a Rodent in "Head First Supine", the brain will be rotated by 90 degrees relative to each other.

This will also probably require some special casing for PV5, as it does not seem to have an option to set this parameter and always specifies SUBJECT_type=Human

CSI(MRSI) Data Conversion to nifti

  • I am trying to convert Bruker CSI data to Nifti. Everything looks OK, except for the excited CSI grid. How I can store it in Nifti? Do you think it is possible? should I use a sidecar file like json?
  • I don't have access PV360, I am really curious how they store CSI in nifti format! in case you know, I appreciate your answer.
  • I tried BrkRaw for CSI data reading; It is really nice tool, but I couldn't load my CSI data. It doesn't support CSI now. does it?
  • It is an example of CSI data. I couldn't share the binary file (2dseq) for this specific data, but here you can find the Parameters files of the anatomical(MRI) and spectroscopic experiments. Download : CSI to nifti example.zip
    Well, I summarized the key differences between files:
VisuPars CSI MRI
Dim 3 2
Size 2048, 16, 16 256, 256
DimDesc 3 2
Spec, Spa, Spa Spa, Spa
Extent 9.99, 30, 35 30,35
unit <ppm, mm, mm> <mm, mm>
seq name CSI RARE

Everything is clear for conversation to nifti except affine matrix and region of interest. In the following you can find my solution, but it is just my understanding of Bruker "magic" black box; so, I would really happy to hear your idea and oponion.

  1. To calculate the affine matrix, my solution is based on this library approach.
    To calculate resolution matrix, I get rid of first element of size and extent matrix and add slice thickness(isn't it meaningless to have slice in MRSI data!?). Then the rest of calculation is exactly like the anatomical image, but with different resolution and voxel(pixel) size.
    So, for calculating qform matrix for CSI; we set qform_code to SCANNER_ANAT(1) which is aligned to scanner (or AlINED_ANT(2)? i am not sure, Correct me if i am wrong).
    here I depicted the idea:
    Presentation1
  2. Excited voxels: this part is more challenging than previous. the excited voxel (voxels of interest) is smaller matrix; but with same resolution. but there was not any parameter in VisuPars file about it. I found information about it in PVM_VOXArrSize and ~_~Position in method file. however; i notice the number is not fit to VisuPars parameters. So, I used VoxelGradOrientation to convert them and then sum them up with half of VisuExtent elements. Right now, I have Position of VOI and resolution as well.
CSI affine matrix
-1.8750 0 0 13.1653
0 0 2.0000 16.5062
0 -2.1875 0 0
0 0 0 1.0000
Anatomical affine matrix
-0.1172 0 0 13.1653
0 0 2.0000 16.5062
0 -0.1367 0, 0
0 0 0 1.0000

Position of VOI: [16.45, 19.33, 0]
Resolution of VOI : [25, 30, 2]

##$PVM_VoxArrSize=( 1, 3 )
30 25 2
##$PVM_VoxArrPosition=( 1, 3 )
-1.83466 1.45244 0

if I calculate everything in a right way, so How i can store them in nifti format? any suggestion?
** this post will be updated

Conversion of T1w FLASH with 2 repetitions crashing

Hi,

I'm using a Bruker Pharmascan.
brkraw v0.3.3rc5
Ubuntu 18 LTS

When I try to convert my 3D_Flash image with 2 repetitions (2 3D volumes) with the GUI, it doesn't let me:

INFO:

Paravision 6.0.1
----------------
UserAccount:	nmrsu
Date:		2019-11-07
Researcher:	Pilot_001
Subject ID:	B03GarzaAlcohol_I2BA_Adol_001
Session ID:	B03GarzaAlcohol_I2BA_Adol_001
Study ID:	1
Date of Birth:	25 Sep 2019
Sex:		male
Weight:		0.201 kg
Subject Type:	Quadruped
Position:	Prone		Entry:	HeadFirst

[ScanID]	Sequence::Protocol::[Parameters]
[001]	Bruker:FLASH::1_Localizer::
	[ TR: 100 ms, TE: 2.50 ms, pixelBW: 159.22 Hz, FlipAngle: 30 degree]
    [01] dim: 2D, matrix_size: 256 x 256 x 3, fov_size: 50 x 50 (unit:mm)
         spatial_resol: 0.195 x 0.195 x 2.000 (unit:mm), temporal_resol: 12800.000 (unit:msec)
[002]	Bruker:FLASH::3D_FLASH_Mn_Garza::
	[ TR: 30.76 ms, TE: 5 ms, pixelBW: 173.61 Hz, FlipAngle: 10 degree]
    [01] dim: 3D, matrix_size: 120 x 160 x 160 x 2, fov_size: 19.0976 x 25.6 x 25.6 (unit:mm)
         spatial_resol: 0.159 x 0.160 x 0.160 (unit:mm), temporal_resol: 694035.840 (unit:msec)
[003]	Bruker:FLASH::1_Localizer::
	[ TR: 100 ms, TE: 2.50 ms, pixelBW: 159.22 Hz, FlipAngle: 30 degree]
    [01] dim: 2D, matrix_size: 256 x 256 x 3, fov_size: 50 x 50 (unit:mm)
         spatial_resol: 0.195 x 0.195 x 2.000 (unit:mm), temporal_resol: 12800.000 (unit:msec)
[004]	Bruker:EPI::SE_EPI_sat::
	[ TR: 2100 ms, TE: 19 ms, pixelBW: 4006.41 Hz, FlipAngle: 90 degree]
    [01] dim: 2D, matrix_size: 72 x 64 x 42 x 300, fov_size: 18 x 16 (unit:mm)
         spatial_resol: 0.250 x 0.250 x 0.550 (unit:mm), temporal_resol: 2100.000 (unit:msec)
[005]	Bruker:FieldMap::B0Map-ADJ_B0MAP::
	[ TR: 20 ms, TE: 0 ms, pixelBW: 1860.12 Hz, FlipAngle: 30 degree]
    [01] dim: 3D, matrix_size: 64 x 64 x 64, fov_size: 45 x 45 x 45 (unit:mm)
         spatial_resol: 0.703 x 0.703 x 0.703 (unit:mm), temporal_resol: 81920.000 (unit:msec)
[006]	Bruker:RARE::T2_TurboRARE::
	[ TR: 4212.78 ms, TE: 33 ms, pixelBW: 140.85 Hz, FlipAngle: 90 degree]
    [01] dim: 2D, matrix_size: 256 x 256 x 24, fov_size: 30 x 30 (unit:mm)
         spatial_resol: 0.117 x 0.117 x 1.200 (unit:mm), temporal_resol: 269617.981 (unit:msec)

https://ibb.co/GTSxJWf

NoneType: None
Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.6/tkinter/__init__.py", line 1705, in __call__
    return self.func(*args)
  File "/home/egarza/.local/lib/python3.6/site-packages/brkraw/ui/main_win.py", line 185, in _save_as
    self._raw.save_as(self._scan_id, self._reco_id, filename, dir=self._output)
  File "/home/egarza/.local/lib/python3.6/site-packages/brkraw/lib/loader.py", line 394, in save_nifti
    niiobj = self.get_niftiobj(scan_id, reco_id, crop=crop)
  File "/home/egarza/.local/lib/python3.6/site-packages/brkraw/lib/loader.py", line 269, in get_niftiobj
    imgobj = self.get_dataobj(scan_id, reco_id, slope=slope)
  File "/home/egarza/.local/lib/python3.6/site-packages/brkraw/lib/loader.py", line 214, in get_dataobj
    raise UnexpectedError(message='Unexpected frame group combination;'
shleeh.errors.UnexpectedError

I also can't see the Image preview in the GUI.

The rest of the sequences were exported fine.

Thank you,

Eduardo

Incompatible with Python 3.8?

Hey, this issue is part of my review of your JOSS submission at openjournals/joss-reviews#2277

I am running Debian bullseye with Python 3.8.3. I cannot install brkraw using this version, because 3.8 is not a supported version.

      python_requires='>3.5, <3.8',

Going through the source code I cannot easily find a reason for that. Is 3.8 incompatible? Do you have plans to support 3.8?

tonii_all fails with cryptic error if run on single dataset

Hi,

I am having an issue when trying to convert my own study using tonii_all.
I get the following message:

$ brkraw tonii_all /Users/matteob/RatScans/20210302_100344_B_B_rat4d_1_1
Traceback (most recent call last):
File "/Users/matteob/miniconda3/miniconda3/envs/myfslpython603/bin/brkraw", line 8, in
sys.exit(main())
File "/Users/matteob/miniconda3/miniconda3/envs/myfslpython603/lib/python3.7/site-packages/brkraw/scripts/brkraw.py", line 184, in main
study = BrukerLoader(sub_path)
File "/Users/matteob/miniconda3/miniconda3/envs/myfslpython603/lib/python3.7/site-packages/brkraw/lib/loader.py", line 93, in init
self._pvobj = load(path)
File "/Users/matteob/miniconda3/miniconda3/envs/myfslpython603/lib/python3.7/site-packages/brkraw/lib/loader.py", line 21, in load
return PvDatasetDir(path)
File "/Users/matteob/miniconda3/miniconda3/envs/myfslpython603/lib/python3.7/site-packages/brkraw/lib/pvobj.py", line 145, in init
self._parse_info()
File "/Users/matteob/miniconda3/miniconda3/envs/myfslpython603/lib/python3.7/site-packages/brkraw/lib/pvobj.py", line 160, in _parse_info
if len(root.split(os.sep)) == root_path_fregs + 1:
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

It does not help if I am in the parent directory or not, the error is the same. Any ideas what may be going wrong?

In the 20210302_100344_B_B_rat4d_1_1 folder I have the structure shown in the two attached images.
I am using brkraw version 0.3.6

Screenshot 2021-03-05 at 13 29 42

Screenshot 2021-03-05 at 13 30 00

brkraw 0.3.4 bids generation for PV5.1 throws unknown error/warning, perhaps phase encoding issue

$ brkraw info 20200707_CIC_PLANTEST_007.325/
Paravision 5.1
--------------
UserAccount:    foujer
Date:           2020-07-07
Researcher:     CIC_PLANTEST_007
Subject ID:     20200707_CIC_PLANTEST_007
Session ID:     CIC_PLANTEST_007_FFS
Study ID:       5
Date of Birth:  None
Sex:            male
Weight:         5 kg
Subject Type:   Human
Position:       Supine          Entry:  FeetFirst

[ScanID]        Sequence::Protocol::[Parameters]
[001]   FLASH (pvm)::1-TriPilot-multi::
        [ TR: 200 ms, TE: 3 ms, pixelBW: 500.80 Hz, FlipAngle: 30 degree]
    [01] dim: 2D, matrix_size: 256 x 256 x 15, fov_size: 60 x 60 (unit:mm)
         spatial_resol: 0.234 x 0.234 x 1.000 (unit:mm), temporal_resol: 25600.000 (unit:msec)
[002]   RARE (pvm)::RARE-T1(modified)::
        [ TR: 700 ms, TE: 9 ms, pixelBW: 542.53 Hz, FlipAngle: 180 degree]
    [01] dim: 2D, matrix_size: 128 x 128 x 10, fov_size: 20 x 20 (unit:mm)
         spatial_resol: 0.156 x 0.156 x 1.000 (unit:mm), temporal_resol: 16800.000 (unit:msec)

$ brkraw tonii -b 20200707_CIC_PLANTEST_007.325/
NoneType: None
Failed..
NifTi file is genetared... [20200707_CIC_PLANTEST_007_5-02-1]

Perhaps a bit more informative, if I use brkraw tonii_all on the parent directory:

$ brkraw tonii_all -b test
NoneType: None
Unexpected phase encoding direction in PV5.1.
20200707_CIC_PLANTEST_007.325 is converted.

Unsubstantiated claim re market share OR citation needed

Hey, this issue is part of my review of your JOSS submission at openjournals/joss-reviews#2277

A bit of a nit pick, but in the paper you state

Bruker Biospin MRI (the leading preclinical MRI system)

I understand that being the leader indirectly justifies the need for BrkRaw. However, "leading" has many connotations, and it would certainly be sufficient to claim that quite a few Bruker systems are in use in the field, without declaring them a "leader" of some kind (without a citation that qualifies this further).

How can correct function be verified?

Hey, this issue is part of my review of your JOSS submission at openjournals/joss-reviews#2277

The code repository does not seem to contain unittests or another kind of tests, and I did not find instructions on how to verify correct behavior for a particular deployment. There is also no CI set up on GitHub. Given that correct behavior of research data IO implementations is crucial (considering their position at the starting point of any analysis), it would be instrumental to be able to verify correct behavior.

This issue is somewhat related to #20 (integration with NiBabel, which comes with an extensive test suite, and test helpers and strategies that could be useful in the context of BrkRaw).

brkraw tonii_all fails while tonii succeeds

$ brkraw --version
brkraw v0.3.3rc1
$ python --version
Python 3.7.6
$ brkraw info raw/
Paravision 5.1
--------------
UserAccount:    galdan
Date:           2020-01-31
Researcher:     MCH_DEV_PHT_001
Subject ID:     20200131_MCH_DEV_PHT_001
Session ID:     dev
Study ID:       1
Date of Birth:  None
Sex:            male
Weight:         5 kg
Subject Type:   Human
Position:       Supine          Entry:  HeadFirst

[ScanID]        Sequence::Protocol::[Parameters]
[001]   FLASH (pvm)::01-TriPilot-multi::
        [ TR: 200 ms, TE: 3 ms, pixelBW: 500.80 Hz, FlipAngle: 30 degree]
    [01] dim: 2D, matrix_size: 256 x 256 x 15, fov_size: 40 x 40 (unit:mm)
         spatial_resol: 0.156 x 0.156 x 1.000 (unit:mm), temporal_resol: 25600.000 (unit:msec)
[002]   FLASH (pvm)::exvivoDanFLASH::
        [ TR: 21.47 ms, TE: 5.11 ms, pixelBW: 96.90 Hz, FlipAngle: 20 degree]
    [01] dim: 3D, matrix_size: 228 x 258 x 130, fov_size: 15.96 x 18.06 x 9.1 (unit:mm)
         spatial_resol: 0.070 x 0.070 x 0.070 (unit:mm), temporal_resol: 1920266.000 (unit:msec)
$ brkraw tonii raw/
NifTi file is genetared... [20200131_MCH_DEV_PHT_001_1-01-1]
NifTi file is genetared... [20200131_MCH_DEV_PHT_001_1-02-1]
$ brkraw tonii_all raw/
Traceback (most recent call last):
  File "/home/gdevenyi/miniforge3/bin/brkraw", line 8, in <module>
    sys.exit(main())
  File "/home/gdevenyi/miniforge3/lib/python3.7/site-packages/brkraw/scripts/brkraw.py", line 143, in main
    study = BrukerLoader(sub_path)
  File "/home/gdevenyi/miniforge3/lib/python3.7/site-packages/brkraw/lib/loader.py", line 88, in __init__
    self._pvobj = load(path)
  File "/home/gdevenyi/miniforge3/lib/python3.7/site-packages/brkraw/lib/loader.py", line 16, in load
    return PvDatasetDir(path)
  File "/home/gdevenyi/miniforge3/lib/python3.7/site-packages/brkraw/lib/pvobj.py", line 145, in __init__
    self._parse_info()
  File "/home/gdevenyi/miniforge3/lib/python3.7/site-packages/brkraw/lib/pvobj.py", line 160, in _parse_info
    if len(root.split(os.sep)) == root_path_fregs + 1:
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'


rostral-caudal axis is flipped for tail prone data

Very nice tool! My only issue is that the rostral-caudal (anterior-posterior) axis is the wrong way around for my tail prone dataset even though the Entry field is correctly identified as "FeetFirst". Is there a way to flip the orientation in this case?

brkraw not working with a dataset

Describe the bug
brkraw works with the example bruker2nifti_qa dataset.
brkraw does not work with another dataset.
Specifically, with another dataset
brkraw bids_helper <dataset> <outputfile> -j works, but produced an empty .xlsx file within only column names.
brkraw bids_convert <dataset> <.xlsx> -j <.json> -o <output folder> does not work, with the following error:

  File "/usr/local/bin/brkraw", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/brkraw/scripts/brkraw.py", line 393, in main
    dset = BrukerLoader(dpath)
  File "/usr/local/lib/python3.7/site-packages/brkraw/lib/loader.py", line 89, in __init__
    self._pvobj = load(path)
  File "/usr/local/lib/python3.7/site-packages/brkraw/lib/loader.py", line 17, in load
    return PvDatasetDir(path)
  File "/usr/local/lib/python3.7/site-packages/brkraw/lib/pvobj.py", line 146, in __init__
    self._parse_info()
  File "/usr/local/lib/python3.7/site-packages/brkraw/lib/pvobj.py", line 163, in _parse_info
    if len(root.split(os.sep)) == root_path_fregs + 1:
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

Tried to debug, but not very fruitful. It requires more background information about the project.
However, this might be helpful:
for a sub folder containing following files:
['AdjStatePerScan', 'specpar', 'acqp', 'fid', 'uxnmr.par', 'uxnmr.info', 'method', 'configscan', 'pulseprogram', 'visu_pars']
The root_path_fregs would be None, causing 'method' condition root_path_fregs + 1 error:

        for root, subdir, files in os.walk(self.__path):
            if 'subject' in files:
                if root_path_fregs is None:
                    root_path_fregs = len(root.split(os.sep))
                    with open(os.path.join(root, 'subject'), 'r') as f:
                        self._subject = Parameter(f.read().split('\n'))
                else:
                    pass
            elif 'method' in files and 'acqp' in files:
                if len(root.split(os.sep)) == root_path_fregs + 1:

cc
@gdevenyi

Paravision 360.2

Is your feature request related to a problem? Please describe.
I am attempting to convert a dataset (single mouse brain, including a T2 RARE and 3x diffusion EPI for the moment). The dataset is already unzipped (originally tar.gz file) so I was attempting to open the directory using the GUI and got the error below (except for "Exception in Tkinter callback" not present for command line). I get the same error on the command line. This was version invariant (tested using 0.3.3 and 0.3.6). This is in a dedicated conda environment with just the required packages + SimpleITK.

Exception in Tkinter callback
Traceback (most recent call last):
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/tkinter/__init__.py", line 1705, in __call__
    return self.func(*args)
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/site-packages/brkraw/ui/main_win.py", line 47, in open_dirdiag
    self._load_dataset()
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/site-packages/brkraw/ui/main_win.py", line 123, in _load_dataset
    self._raw = load(self._path)
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/site-packages/brkraw/__init__.py", line 8, in load
    return BrukerLoader(path)
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/site-packages/brkraw/lib/loader.py", line 93, in __init__
    self._pvobj = load(path)
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/site-packages/brkraw/lib/loader.py", line 21, in load
    return PvDatasetDir(path)
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/site-packages/brkraw/lib/pvobj.py", line 145, in __init__
    self._parse_info()
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/site-packages/brkraw/lib/pvobj.py", line 160, in _parse_info
    if len(root.split(os.sep)) == root_path_fregs + 1:
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

I additionally attempted the command line on the Zip file and received the following error regardless of GUI or command line (only difference is the "Exception in Tkinter callback")

Exception in Tkinter callback
Traceback (most recent call last):
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/tkinter/__init__.py", line 1705, in __call__
    return self.func(*args)
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/site-packages/brkraw/ui/main_win.py", line 40, in open_filediag
    self._load_dataset()
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/site-packages/brkraw/ui/main_win.py", line 123, in _load_dataset
    self._raw = load(self._path)
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/site-packages/brkraw/__init__.py", line 8, in load
    return BrukerLoader(path)
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/site-packages/brkraw/lib/loader.py", line 93, in __init__
    self._pvobj = load(path)
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/site-packages/brkraw/lib/loader.py", line 24, in load
    return PvDatasetZip(path)
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/site-packages/brkraw/lib/pvobj.py", line 205, in __init__
    self._parse_info()
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/site-packages/brkraw/lib/pvobj.py", line 236, in _parse_info
    self._acqp[scan_id] = Parameter(f.read().decode('UTF-8').split('\n'))
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/site-packages/brkraw/lib/parser.py", line 7, in __init__
    self._set_param(*load_param(stringlist))
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/site-packages/brkraw/lib/parser.py", line 44, in _set_param
    self._parameters[key] = convert_data_to(data, shape)
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/site-packages/brkraw/lib/utils.py", line 98, in convert_data_to
    if any([',' in cell for cell in is_array]):
  File "/home/u26/adamraikes/.conda/envs/bruker/lib/python3.7/site-packages/brkraw/lib/utils.py", line 98, in <listcomp>
    if any([',' in cell for cell in is_array]):
TypeError: argument of type 'int' is not iterable

Describe alternatives you've considered
I suspect that this is a difference between folder structure for PV5/6 and PV360.2 (which we are running). Is there any way to make BrkRaw compatible with 360.2 data as well?

I can provide tarred datasets if helpful.

PV6 Supine vs Prone does not change conversion

I have been collecting validation datasets for conversion and run into a conversion bug, which was handled properly in 0.3.4, and is wrong in HEAD.

I have a phantom brain in the scanner, physically in the orientation "Head First Prone". I have collected two scans, with PV6 configured as Quadruped, and one scan "Head First Prone" and another "Head First Supine".

brkraw info properly reports the difference in the data:

$ brkraw info 20200814_164540_CIC_PLANTEST_008_PV6_1_1/
Paravision 6.0.1
----------------
UserAccount:    foujer
Date:           2020-08-14
Researcher:     CIC_PLANTEST_008_PV6
Subject ID:     CIC_PLANTEST_008_PV6
Session ID:     CIC_PLANTEST_008_PV6
Study ID:       1
Date of Birth:  14 Aug 2020
Sex:            unknown
Weight:         0.001 kg
Subject Type:   Quadruped
Position:       Prone           Entry:  HeadFirst

[ScanID]        Sequence::Protocol::[Parameters]
[001]   Bruker:FLASH::1_Localizer_multi_slice::
        [ TR: 15 ms, TE: 3 ms, pixelBW: 212.30 Hz, FlipAngle: 10 degree]
    [01] dim: 2D, matrix_size: 192 x 192 x 15, fov_size: 25 x 25 (unit:mm)
         spatial_resol: 0.130 x 0.130 x 2.000 (unit:mm), temporal_resol: 129600.000 (unit:msec)
[002]   Bruker:FLASH::T1_FLASH_3D::
        [ TR: 10 ms, TE: 4 ms, pixelBW: 300.48 Hz, FlipAngle: 10 degree]
    [01] dim: 3D, matrix_size: 96 x 96 x 96, fov_size: 20 x 20 x 20 (unit:mm)
         spatial_resol: 0.208 x 0.208 x 0.208 (unit:mm), temporal_resol: 92160.000 (unit:msec)
$ brkraw info 20200814_170107_CIC_PLANTEST_008_PV6_1_2/
Paravision 6.0.1
----------------
UserAccount:    foujer
Date:           2020-08-14
Researcher:     CIC_PLANTEST_008_PV6
Subject ID:     CIC_PLANTEST_008_PV6
Session ID:     CIC_PLANTEST_008_PV6_HFS
Study ID:       2
Date of Birth:  14 Aug 2020
Sex:            unknown
Weight:         0.001 kg
Subject Type:   Quadruped
Position:       Supine          Entry:  HeadFirst

[ScanID]        Sequence::Protocol::[Parameters]
[001]   Bruker:FLASH::1_Localizer::
        [ TR: 100 ms, TE: 2.50 ms, pixelBW: 256.99 Hz, FlipAngle: 30 degree]
    [01] dim: 2D, matrix_size: 256 x 256 x 3, fov_size: 30 x 30 (unit:mm)
         spatial_resol: 0.117 x 0.117 x 2.000 (unit:mm), temporal_resol: 12800.000 (unit:msec)
[002]   Bruker:FLASH::T1_FLASH_3D::
        [ TR: 10 ms, TE: 4 ms, pixelBW: 300.48 Hz, FlipAngle: 10 degree]
    [01] dim: 3D, matrix_size: 96 x 96 x 96, fov_size: 20 x 20 x 20 (unit:mm)
         spatial_resol: 0.208 x 0.208 x 0.208 (unit:mm), temporal_resol: 92160.000 (unit:msec)
[003]   Bruker:FLASH::T1_FLASH_3D::
        [ TR: 10 ms, TE: 4 ms, pixelBW: 300.48 Hz, FlipAngle: 10 degree]
    [01] dim: 3D, matrix_size: 96 x 96 x 96, fov_size: 20 x 20 x 20 (unit:mm)
         spatial_resol: 0.208 x 0.208 x 0.208 (unit:mm), temporal_resol: 92160.000 (unit:msec)

However, after conversion, both the datasets are in the same orientation:
image

Left: correct orientation
Middle: incorrect orientation, should be rotated

The last commit to touch this code was: eaa6db0

In 0.3.4, it looks like subj_position is ignored for PV6 and applied to PV5, where as in master, it is applied unconditionally.

[bids output] CogAtlasID should match format "uri", so does CogPOID

For some of the bids output .json file, when the value of CogAtlasID is "Value was not specified", the bids validator raise
'.CogAtlasID should match format "uri" ' error. So does CogPOID.

This relates to #36, but that issue carries too much weight, I think put this as a separate issue would benefit users and make things more manageable.

Failed EPI conversion to nifti

Hi,

I have tried the conversion to nifti on the following mouse EPI acquisition:

Paravision 5.1
--------------
UserAccount:	galdan
Date:		2019-08-07
Researcher:	MCH_MFC_058
Subject ID:	20190807_MCH_MFC_058
Session ID:	mfc
Study ID:	1
Date of Birth:	None
Sex:		male
Weight:		5 kg
Subject Type:	Human
Position:	Supine		Entry:	HeadFirst

[ScanID]	Sequence::Protocol::[Parameters]
[001]	FLASH (pvm)::01-TriPilot-multi::
	[ TR: 200 ms, TE: 3 ms, pixelBW: 500.80 Hz, FlipAngle: 30 degree]
    [01] dim: 2D, matrix_size: 256 x 256 x 15, fov_size: 40 x 40 (unit:mm)
         spatial_resol: 0.156 x 0.156 x 1.000 (unit:mm), temporal_resol: 25600.000 (unit:msec)
[003]	RARE (pvm)::04_TriPilot_RARE::
	[ TR: 2500 ms, TE: 33 ms, pixelBW: 183.11 Hz, FlipAngle: 180 degree]
    [01] dim: 2D, matrix_size: 256 x 256 x 3, fov_size: 19.2 x 19.2 (unit:mm)
         spatial_resol: 0.075 x 0.075 x 0.500 (unit:mm), temporal_resol: 80000.000 (unit:msec)
[004]	EPI (pvm)::grandjeanDG_epi_v1::
	[ TR: 1000 ms, TE: 15 ms, pixelBW: 4006.41 Hz, FlipAngle: 50 degree]
    [01] dim: 2D, matrix_size: 75 x 40 x 26 x 780, fov_size: 18.6851476050082 x 10 (unit:mm)
         spatial_resol: 0.249 x 0.250 x 0.500 (unit:mm), temporal_resol: 1000.000 (unit:msec)
[005]	FLASH (pvm)::grad_epi_T1_reg::
	[ TR: 20 ms, TE: 4.50 ms, pixelBW: 137.36 Hz, FlipAngle: 20 degree]
    [01] dim: 3D, matrix_size: 170 x 182 x 170, fov_size: 17 x 18.2 x 17 (unit:mm)
         spatial_resol: 0.100 x 0.100 x 0.100 (unit:mm), temporal_resol: 870400.000 (unit:msec)

I ran the following, and the EPI file wasn’t successfully converted:

~/Work/dev/brkraw$ brkraw tonii 20190807_MCH_MFC_058.UE1/
NifTi file is genetared... [20190807_MCH_MFC_058_1-01-1]
NifTi file is genetared... [20190807_MCH_MFC_058_1-03-1]
NoneType: None
Failed..
NifTi file is genetared... [20190807_MCH_MFC_058_1-05-1]

Any idea regarding the source of the issue?

A copy of the data can be found here https://drive.google.com/drive/folders/1hcXVsyeTWRcK76OJ1VNQtAXdfJ91vBWf?usp=sharing

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.