GithubHelp home page GithubHelp logo

macquarie-meg-research / biscuit Goto Github PK

View Code? Open in Web Editor NEW
7.0 8.0 1.0 20.25 MB

GUI for easy MEG to BIDS conversion

Home Page: https://macquarie-meg-research.github.io/Biscuit/

License: MIT License

Python 99.14% JavaScript 0.42% HTML 0.44%
bids meg magnetoencephalography neuroimaging

biscuit's Introduction

Biscuit

biscuit

Convert your MEG data to a BIDS compliant format

Biscuit is a simple graphical application that facilitates the reformatting of raw KIT and Elekta MEG data to comply with the international BIDS Standard. Current discussion on the BIDS specification can be found here.

Biscuit requires at least Python 3.7

For full installation and usage instructions visit the Biscuit GitHub page

Biscuit uses MNE-Python and MNE-BIDS to load the MEG data and convert to BIDS format.

Note: Because the BIDS specification is still being developed the output is likely to change over the next few months, so the data generated currently may not be BIDS compliant in the future. This is an unavoidable side-effect of this being developed while the BIDS specifcation is still in active development.

biscuit's People

Contributors

jd-zhu avatar monkeyman192 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

clara1989

biscuit's Issues

Fix 'Default project settings window' to have maximum size

Once many project settings have been added the window may become larger than the screen.
The WidgetsTable widget will need to be modified so it can have maximum rows provided.
It might also be worth having the project settings list sorted by the project ID while modifications are being made to it.
The maximum number of rows should be specified in the settings window so that people with different sized monitors can adjust it.

Add refresh button to file treeview

For uses where Biscuit will be open for extended periods of time while data is being acquired, it would be convenient to allow for refreshing of the file treeview from the GUI.

To achieve this we need to move the functionality for constructing all the data into the EnhancedTreeview.
Because this will make the EnhancedTreeview less generic I think we should create a new subclass FileTreeview which inherits from EnhancedTreeview, but has some extra methods. Also a few recently added methods should probably be added to the FileTreeview instead of the EnhancedTreeview (anything non-generic).

TODO:

  • Create FileTreeview class
  • Move main._fill_file_tree() in Biscuit.py into FileTreeview as a method.
  • Add new update method which can detect changes between the source directory and the current structure and just add new files/folders as required (without modifying any existing items in the treeview).
  • Allow refresh to detect files that have been removed.

These changes will also need to be merged into the MQ_master branch to ensure uniformity of base code across branches

Remove custom MNE-BIDS and add as dependency

Currently Biscuit uses a custom modified MNE-BIDS that has some extra features, but is also behind in many others.
Now that MNE-BIDS has it's 0.1 release officially done and API (hopefully) finalised it would be good to remove MNE-BIDS as an internal resource and use the external package.

This will require a few things:

  • Reworking of Management/BIDSConvert.py to use the new MNE-BIDS API.
  • Writing a post-processing script to cover any data that is generated by the custom MNE-BIDS within Biscuit that cannot/won't be supported (at least in the near future). This includes:
  • Writing in the Dewar Position
  • Continuous head localisation info
  • software filter information
  • Empty room info (Should be added to MNE-BIDS, so won't need post-processing)
  • Serial number
  • Groups for participants

Allow folders to be sent to external drives

To allow easy merging of converted data there should be a context menu option to send the data to an external drive.
The merging capabilities should possibly be brought into the master branch also in some way.

  • Add context menu to merge-transfer data to a selected location.

default readme in BIDS dataset after conversion

hey

We (BIDS maintainers) are trying to see if we can improve the quality of the average README in BIDS dataset. Those tend to be pretty thin and are missing some information we would like to see there even if it cannot be formalized "yet" into the BIDS specification.

Hoping to leverage the bids converters to help to do.

So I am going around the different BIDS converters repo to see if we can start improving the default README they put in a the BIDS dataset.

There is template that is provided in the BIDS starter kit: https://github.com/bids-standard/bids-starter-kit/blob/main/templates/README.MD

Some possible options:

  1. use this template is
  2. use a subset of it
  3. add a link to the template README
  4. something else (a mix of 2 and 3?)

What do you think? I can try to open a PR if you want.

Also let us know if you think that the template README in the starter kit could / should be improved .

Feel free to disregard if you are already using some version of the template README.

Right click on Mac

I did a clean install on Friday. RIght click for mac (ctrl left click) doesn't work. When I connect PC mouse to mac it works with right click.

Add normal settings menu

Since the MQ branch has been merged into the main branch, some of the settings should be un-hardcoded so that others using the program can customise how it works. These settings include:

  • frequency to chunk BIDS data.
  • This is how often a new BIDS folder is created. For single users this should be 'Never', but for large groups or on a lab computer this should be as often as the data is to backed up to an external source (eg. number of weeks)
  • Add option to allow file verification on transfer or not?
  • Specify path to archive
  • Specify network host name (for user credential log in if needed...)
    ...
    maybe others if I think of them?

Biscuit does not start due to missing path name

Hi,
I'm trying to use Biscuit to convert MEG Data to BIDS on Ubuntu 22.04.

Describe the bug
I installed Biscuit according to the instructions on https://macquarie-meg-research.github.io/Biscuit/installation/ using the "Complete" Install.
When I try to run Biscuit (either directly from the command line using "Biscuit" or from within Python 3.10, I get the error:

Traceback (most recent call last):
File "", line 1, in
File "/home/neuraltrain/anaconda3/lib/python3.10/site-packages/Biscuit/init.py", line 16, in run
m = MainWindow(master=root)
File "/home/neuraltrain/anaconda3/lib/python3.10/site-packages/Biscuit/Windows/MainWindow.py", line 72, in init
self._load_settings()
File "/home/neuraltrain/anaconda3/lib/python3.10/site-packages/Biscuit/Windows/MainWindow.py", line 164, in _load_settings
if not op.exists(self.settings["DATA_PATH"]):
File "/home/neuraltrain/anaconda3/lib/python3.10/genericpath.py", line 19, in exists
os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not tuple

To Reproduce

  1. install Biscuit on Ubuntu 3.10: (base) neuraltrain@neuraltrain-laptop:~$ pip install -U https://github.com/Macquarie-MEG-Research/Biscuit/releases/download/v0.9.9/Biscuit-0.9.9complete-py3-none-any.whl
  2. Run Biscuit: (base) neuraltrain@neuraltrain-laptop:~$ Biscuit
  3. Alternatively, open Python, import "run" from Biscuit and run():
    (base) neuraltrain@neuraltrain-laptop:~$ python3
    Python 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.

from Biscuit import run
run()

Expected behavior
On Windows, starting Biscuit directly from the command line does not work, but starting from within Python works.

Error message produced
Traceback (most recent call last):
File "", line 1, in
File "/home/neuraltrain/anaconda3/lib/python3.10/site-packages/Biscuit/init.py", line 16, in run
m = MainWindow(master=root)
File "/home/neuraltrain/anaconda3/lib/python3.10/site-packages/Biscuit/Windows/MainWindow.py", line 72, in init
self._load_settings()
File "/home/neuraltrain/anaconda3/lib/python3.10/site-packages/Biscuit/Windows/MainWindow.py", line 164, in _load_settings
if not op.exists(self.settings["DATA_PATH"]):
File "/home/neuraltrain/anaconda3/lib/python3.10/genericpath.py", line 19, in exists
os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not tuple

Operating system/Python environment

  • OS: Ubuntu 3.10
  • Python version and install method: Python 3.10.10 | packaged by conda-forge
  • Current version of MNE : 1.3.1

Additional context
When first also importing MNE, the error message changes to:
Traceback (most recent call last):
File "", line 1, in
File "/home/neuraltrain/anaconda3/envs/mne/lib/python3.10/site-packages/Biscuit/init.py", line 16, in run
m = MainWindow(master=root)
File "/home/neuraltrain/anaconda3/envs/mne/lib/python3.10/site-packages/Biscuit/Windows/MainWindow.py", line 53, in init
self.master.tk.call('wm', 'iconphoto', self.master._w, img)
_tkinter.TclError: can't use "pyimage2" as iconphoto: not a photo image

Thanks a lot for your help!
Best,
Julian

Fix various Linux issues

Nothing specific, just need to do more testing on linux to ensure settings all work.

  • Cannot open the settings directory (file:// not valid on linux I think...)
  • OSCONST.USRDIR is not correct for linux
  • Checkbuttons look awful
  • Right click menu doesn't disappear when clicking somewhere else.

Multiple bugs to fix

Describe the bug
Number of bugs to be Fixed for 0.9.8:

  • - (1) Trigger list descriptions aren't updated correctly
  • - (2) emptyroom auto determination needs str.tolower()
  • - (3) Refresh when adding new data doesn't work.
  • - (4) Generate BIDS button doesn't re-activate.
  • - (5) Associated empty room BIDS data won't be brought along with other data (see: Macquarie-MEG-Research/BIDSHandler#12)

To Reproduce
(1):

  1. Add options to the defaults then look at trigger channel list.
  2. Add more options or rename some then look again.

(4):

  1. Have two folders. One with good data, one un-checked.
  2. Check the other one then click back on the first one. Generate BIDS button won't be re-activated.

Add defaults for project tasks

In the project settings window it would be good to be able to specify a set of tasks that can be selected from a drop down in much the same way that groups are specified

Make Biscuit BIDS-aware

Being able to understand that a folder is in BIDS format would be very useful as we can then see what data is contained and Biscuit could be used to view BIDS compatible MEG data as well as produce it.

There are a number of functions required for this functionality:

  • Understand a folder contains BIDS data
  • Ability to merge in folders containing BIDS data into other folders.
  • Search BIDS folders and export the results to another location

Doing so will require writing separate code similar to how pybids works, but for MEG data.
The API should be able to handle calls like:

p = Project('P1234')
# assign some subjects/scans etc.
p.subjects # would return a list of Subject objects
p.subject('123') # would be the subject in the project with subject id of '123'
p.subject('123').scans # list of Scan objects

etc.

Automatically detect empty room file in the same folder

For KIT data it should be simple enough to determine whether or not there is another file in the same folder which is marked as an empty room file and update the other .con files accordingly to indicate that they have empty room data.
For Elekta data we may need to modify the Folder class to handle this, otherwise potentially just have a method in the FIFData struct which detects other fif files in the folder and checks them for the empty room property and date and auto assign that way (probably best way)

  • Autodetect empty room for KIT data
  • Autodetect empty room for Elekta data

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.