Is this is a trend?

Trends are not always a good thing. Sometimes trends can obscure the things that are really important. A common problem in signal processing is that measured data can be affected by signal drifts – for example, due to temperature changes in your sensor or the thing that you try to measure. To get rid of these drifts the signal can be detrended. This filtering is a standard data processing step for many applications.

However, in real-time fMRI we need to perform this detrending online, that is, while we acquire the data. This is not so trivial, so Rotem Kopel, Frank Scharnowski, and I wrote a paper about it.

Kopel R & Sladky R, Laub P, Koush Y, Robineau F, Hutton C, Weiskopf N, Vuilleumier P, Van De Ville D, Scharnowski F. No time for drifting: Comparing performance and applicability of signal detrending algorithms for real-time fMRI. NeuroImage 2019

sweetData: a versatile open-source tool for lab data management and validation

Note: this abstract has been submitted as an abstract for the OHBM2019 meeting in Rome, Italy.

I am interested in collaborations on this project. If you are interested and have experience with JavaScript/Node.js/Vue.js, please get in touch with me.

This is a current development snapshot of our project. Contact me if you intend to use it in your lab to get the latest updates.

Introduction. A ubiquitous challenge for neuroimaging and other forms of empirical research is the organization and quality assessment of collected data. Nowadays there are excellent standards for organizing datasets, such as BIDS (Gorgolewski et al., 2017)and the OpenfMRI format (Poldrack et al., 2013). These structured datasets are optimized for machine-processability, enabling the use of automated scripts for safe and secure data storage, efficient data processing using computational pipelines, and intuitive collaboration between labs. However, before data actually conforms with the a prioridefined syntax and semantics, data needs to be manually transferred and rearranged in an unstructured and insecure fashion across different systems and air-bridged devices, such as an MRI scanner, lab bench, and online questionnaire servers (Figure 1A). Typical solutions for this problem are (a) relying that all lab members are able to responsibly organize their data independently (the hoping for the bestapproach), (b) all data is handed over to one or a few data science experts who are responsible for data management and assessment (the hoping that they will never leave the labapproach), and (c) hybrid approaches where data experts define strict policies on how to organize the data and expect all members (including those with different project requirements) to follow these guidelines (the creating lots of frustration on both sidesapproach). To a different degree, all of these options entail problems such as potential data loss, hard to manage data security and backup strategies, and storage policies that are too inflexible to be applicable for all types of studies. In interdisciplinary teams, it cannot be expected that the required data management skills and coding competences are present in all lab members. This applies in particular for, e.g., the new lab member with a background in molecular psychiatry or the neurophenomenology full professor who cannot be expected to run obscure bash scripts on the lab server to monitor the project’s progress. This was the motivation for developing sweetDatathat provides a user-friendly, efficient, modular, and open framework for management of raw source data. 

Methods. sweetData is being developed in JavaScript using Node.js (v8.11.1, Node.js Foundation) featuring a server module based on Express.js (v4.16.4) and a customizable front-end implemented in Vue.js (v2.5.17) with HTML/CSS. sweetData’s server component is a stand-alone webserver responsible for validating the project’s files and folder structure and reporting its status (Figure 1B). The sweetData client (or any other client application, Figure 2A) can access the server-sided service via an API, allowing for a scalable, flexible, and future-proof architecture. The project semantics, i.e., the way files should be organized within a project, are defined using a customizable JSON file (Figure 2B/C).

Results. Currently, sweetData supports the management of text, DICOM, and NIFTI files. A development snapshot of sweetData is provided online ( and collaboration in this project, in particular to add new data formats (e.g., EEG data, MAT files) is highly encouraged.

Conclusions. With an ever-increasing number of files and heterogeneous data sources, robust and practicable solutions for project data management are highly relevant. Standardized fMRI reporting formats and international collaborations require the use of structuralized and reproducible forms of data management. While software exists for validating if a project conforms to BIDS, a more general form of data validation to customized schemas optimized for source data has been missing. sweetData can provide an interface to enable translating heterogenous forms of source data into a self-defined, well-ordered, structured project format. Finally, these datasets can be converted to other standardized data management schemas.

Figure 1A. sweetData workflow.Typically, source data is manually collected (e.g., via USB drives) from heterogeneous data sources. Then, data can be ordered and validated using sweetData. If successfully validated, this data can be converted easily to other data organization formats, such as BIDS, using re-usable scripts. B. sweetData architecture.sweetData can run within a modern web browser or as an electron stand-alone application. Modularity of user interface, client logic, server, and data storage allow for distributed implementations, if needed. The client software requests information, such as a representation of the project’s file/object tree, via the server’s API. The result is delivered as a JSON object that can be parsed by the client.

Figure 2A. sweetData user interface. The user interface is implemented in JavaScript, Vue.js framework, HTML, and CSS and can be easily adapted to new use cases, such as displaying new data formats. Identified entities and validation errors (e.g., missing folder, filesize to small), warnings (e.g., missing optional entity) or notes (e.g., unknown/unnecessary file) are highlighted in the project tree. B Example project config file.A JSON file is used to store the relationships of different entities within a project. In this example, it is assumed that a project rootcontains at least one Subject(e.g., a folder named clamy17-e01), which must contain the folders OpenNFT,MRIDRIN, and LogsMRI, in turn, contains different types of NIFTI files, which have a minimum file size and a minimum number of volumes.C Graph of the relationships described in the JSON file.


Gorgolewski, K.J., Alfaro-Almagro, F., Auer, T., Bellec, P., Capota, M., Chakravarty, M.M., Churchill, N.W., Cohen, A.L., Craddock, R.C., Devenyi, G.A., Eklund, A., Esteban, O., Flandin, G., Ghosh, S.S., Guntupalli, J.S., Jenkinson, M., Keshavan, A., Kiar, G., Liem, F., Raamana, P.R., Raffelt, D., Steele, C.J., Quirion, P.O., Smith, R.E., Strother, S.C., Varoquaux, G., Wang, Y., Yarkoni, T., Poldrack, R.A., 2017. BIDS apps: Improving ease of use, accessibility, and reproducibility of neuroimaging data analysis methods. PLoS Comput Biol 13, e1005209.

Poldrack, R.A., Barch, D.M., Mitchell, J.P., Wager, T.D., Wagner, A.D., Devlin, J.T., Cumba, C., Koyejo, O., Milham, M.P., 2013. Toward open sharing of task-based fMRI data: the OpenfMRI project. Front Neuroinform 7, 12.

Can cocaine users self-regulate their dopaminergic reward circuit using neurofeedback?

We found evidence that people can upregulate their dopaminergic reward circuit using mental imagery. This works even better when they receive fMRI neurofeedback of their substantia nigra brain region. Interestingly, this also appears to work in cocaine users – at least in those without strong obsessive-compulsive drug use.

Like we showed in our study on the Aha!-moment, mentally generated feelings of reward can activate brain areas that produce dopamine. Could neurofeedback be a new form of self-guided cognitive brain stimulation?

Self-regulation of the dopaminergic reward circuit in cocaine users with mental imagery and neurofeedback. Matthias Kirschner, Ronald Sladky, Amelie Haugg, Philipp Stämpfli, Elisabeth Jehli, Martina Hodel, Etna Engeli, Sarah Hösli, Markus R Baumgartner, James Sulzer, Quentin J M Huys, Erich Seifritz, Boris B Quednow, Frank Scharnowski, Marcus Herdener.

OpenNFT: a real-time fMRI neurofeedback software

I am actively contributing to a project by Yury Koush (MRRC, Yale University) together with John Ashburner and Peter Zeidman (Functional Imaging Laboratory, University College London), Frank Scharnowski (University of Zurich), Dimitri Van De Ville (EPFL Geneva), Evgeny Prilepin, Sergei Bibikov and Artem Nikonorov (Samara State Aerospace University).

OpenNFT is an open-source framework for neurofeedback training based on real-time fMRI.

Check out our project website for additional details and to download the software:

Chair elect for Interdisciplinary College 2018

I am happy (and extremely proud) that Prof. Ipke Wachsmuth (left, Professor (emerit.) for Artificial Intelligence, Bielefeld University), me (and Lea, who attended IK for the second time), and Dr. Katharina Krämer (right, Psychologist, University of Cologne) will be given the opportunity to chair the next Interdisciplinary College.

Our Focus theme will be: Me, my Self and I. Who am I? Where is my self? What is it like to be ‘me’? We now have started working on an interdisciplinary course program that covers different aspects of self models, self perception, and selfhood.

sweetView: a simple, quick, and powerful viewer for MRI images and SPM results

We all love SPM. However, creating really nice figures for your talk or publication typically involves quite a lot of manual labor and post processing. And then, just when you are done and send the figures to your co-authors, you are informed that you need to exclude one subject from group analysis because their drug screening was positive (or negative – depending on the study).

Things like this happen and this was my motivation to create sweetView a simple and powerful viewer for MRI images and SPM results that allows you to quickly create triplanar or mosaic overlays of your SPM results. The core features include fast selection of images, easily customizable overlays for masks or SPMs, adding (anatomical) labels and saving the slice selection and multiple cursor positions, so you can easily reproduce your original figure design.

The software has been designed for people who use Matlab and SPM12.


Development roadmap:

  • sweetView v0.4. User experience. Rewriting user interface backend code, easier interface for global/local view settings, color picker, multiple windows (May 2017).
  • sweetView v0.6. Masking. Create masks, brain atlas integration, smart functional masks (July 2017)
  • sweetView v0.8. Time. 4D NIFTIs, time series, animations (Sept. 2017)
  • sweetView v1.0. Major release. Dissemination and release (Oct. 2017)


First Brainhack Zurich


Together with Amelie Haugg, Franz Liem, Jessica Oschwald, Frank Scharnowski, and Vivian Steiger, I will co-organize the first Brainhack in Zurich.

Brainhack workshops offer an open platform for brain-imaging scientists of all levels of experience to meet and discuss new ideas. In the beginning of March, over forty sites across the globe will simultaneously hold Brainhack events (

The Zurich Brainhack will focus on introductory hands-on tutorials on tools for (neuroimaging) data analysis to promote reproducible science. The event also aims to connect the Swiss neuroscience community by providing a space for open discussion.

The admission is free but registration until February 24th is required. More information on

New interview: ‘From Star Trek to human enhancement’

My new interview for a Slovenian CogSci platform is online:

The last conversation this year in the Scientific Cognition series features Dr. Toni Pustovrh, assistant professor and researcher at the Faculty of Social Sciences (FSS) at the University of Ljubljana, Slovenia, and Dr. Ronald Sladky, postdoctoral researcher at the University of Zurich, Switzerland.
Dr. Toni Pustovrh is an assistant professor at the Chair for Cultural Studies and a researcher at the Centre for Social Studies of Science at FSS in Ljubljana. He focuses on ethical, legal and social implications of new emerging technologies, human enhancement, bioethics and neuroethics. He also works as a translator of scientific articles and books on science and technology.
Dr. Ronald Sladky is a postdoctoral researcher at the Department for Psychiatry, Psychotherapy and Psychosomatics at the University Hospital of Psychiatry at the University of Zurich. For his doctoral thesis in medical physics at the Medical University of Vienna, he investigated the methodology of functional magnetic resonance imaging (fMRI) and brain connectivity. He is now focusing on how neurofeedback in fMRI studies may benefit psychiatric patients.

Here is the link to the interview transcript and the YouTube video:

Dr. Toni Pustovrh & Dr. Ronald Sladky: From Star Trek to human enhancement



I created this tool a couple of years ago to automatically create larger model spaces based on a single template file. Sometimes there is uncertainty about the presence or absence of a connection in your model. In DCM you account for that by manually creating two models where this connections is either turned on or off and compare there respective model evidences. It is easy to see that this manual approach is tedious for larger model spaces, when there is uncertainty about many connections.

sweetDCMvariate Create DCM models within a given model space based on a given template file. Template files should be created with the official SPM functions or compatible implementation. This tool will then create all variations of connectivity priors as defined in the template model.

Download file: sweetDCMvariate.m
Need some help? Found a bug? Please contact me.