import_nhp#

qx_utilities.nhp.import_nhp.import_nhp(sessionsfolder=None, inbox=None, sessions=None, action='link', overwrite='no', archive='leave', _log=None)#

import_nhp [sessionsfolder=.] [inbox=<sessionsfolder>/inbox/NHP] [sessions=""] [action=link] [overwrite=no] [archive=leave]

Maps NHP data to the QuNex Suite file structure.

Parameters

--sessionsfolder (str, default '.'):

The sessions folder where all the sessions are to be mapped to. It should be a folder within the <study folder>.

--inbox (str, default '<sessionsfolder>/inbox/NHP'):

The location of the NHP dataset or a dataset archive. It can be a folder that contains the NHP datasets or compressed .zip or .tar.gz packages that contain a single session or a multi-session dataset. For instance the user can specify "<path>/<nhp_file>.zip" or "<path>" to a folder that contains multiple packages.

--sessions (str, default ''):

An optional parameter that specifies a comma or pipe separated list of sessions from the inbox folder to be processed. Regular expression patterns can be used. If provided, only packets or folders within the inbox that match the list of sessions will be processed. If ` inbox` is a file sessions will not be applied. Note: the session will match if the string is found within the package name or the session id. So "NHP" with match any zip file that contains string "NHP" or any session id that contains "NHP"!

--action (str, default 'link'):

How to map files: link, copy, or move.

--overwrite (str, default 'no'):

Whether to overwrite existing data (yes) or not (no).

--archive (str, default 'leave'):

What to do with the archive after mapping.

Options are:

  • leave (leave the specified archive where it is)

  • move (move the specified archive to <sessionsfolder>/archive/NHP)

  • copy (copy the specified archive to <sessionsfolder>/archive/NHP)

  • delete (delete the archive after processing if no errors were identified)

Please note that there can be an interaction with the action parameter. If files are moved during action, they will be missing if archive is set to "move" or "copy.

Outputs:

After running the import_nhp command the NHP dataset will be mapped to the QuNex folder structure and image files will be prepared for further processing along with required metadata.

  • dMRI images for each session will be stored in:

    <sessionsfolder>/<session>/dMRI

Notes

The import_nhp command first inspects the location of the NHP dataset (specified by the inbox parameter) for suitable data. When looking for suitable data QuNex looks for dMRI subfolder inside each of the <session> folders (whether in the inbox folder or in archived data). Meaning that the data inside inbox folder or achives should be structured as:

/<session>/<dMRI>/<image files>

Examples

qunex import_nhp sessionsfolder=myStudy/sessions inbox=myData/NHP overwrite=yes