Skip to content

nbeliy/arc-actigraphy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to install

Prerequisits

In order to connect to server (visualizing and creating sleep journals will work out of the box), an Fuse and sshfs should be installed.

sshfs (secure shell file system) is a way to mount an arbitrary folder from server as local shared folder using UNIX standard encripted protocol ssh.

For MacOS, both can be downloaded fron developper site: MacFuse, and installation instructions here.

Outside the standard click on the package, Mac will require to enable third party kernel extensions

and to allow kernel to load.

Once done, and after a reboot (because Mac hates people!), the sshfs should work.

Configuration

At the first launch, it will take 10-20 seconds, because one of the libraries (matplotlib) willcreate a cahce file for fonts. I don't know yet how to bypass this.

Once sshfs is installed, you need configure the app. To do so, go to the menu (it's says Python in top left corner of screen), and click on configure.

From there, you need to first, provide the path to the autentification keys that you should recieve beforehand. First give path to your key (id_rsa.hab.<your name>.pub), and then to the encoder one (rsa.hab.encoder.pub). The default location of keys is in your home directory, in hidden folder .ssh, but you can store it where you want. Just be sure that this place is not accessible for other users (e.g. not in the shared folder).

If you see an error about key protection, then refer to the readme file that came wth keys.

Once the keys are set up, other parameters should be filled automatically. Leave them be, but verify that User is your family name and not encoder.

If all is good, you can close configuration.

Conecting to server

You need to be connected to ULiege network (probaly also eduroam could work). If you are outside ULiege, use VPN.

Go to the Remote connection tab, where you will see two connect bottons:

  • Raw data storage: will connect to the read only storage for raw data (actigraphy and photos)
  • Shared data storage: will conect to the shared space on server, where you can store whatever you want.

Clicking connect should create a folder on the desktop. These are remote folders to the server. You can access files on them as you access files on your computer.

Closing the app will not disconnect the folders, you can do it manually just ejecting them.

Uploading actigraphy and images data

In the Upload tab, select the corresponding id of subject (for ex. 2), and id of visite. If you do the test transfert, prepend subject by t: t32 to indicate that it is the test subject.

Then you can select an actigraphy file, and photos to upload. Once selected, you can click on Upload to server to launc transfert.

In one or two minutes you should see the uploaded files in the Raw data storage, in Visit_data folder. If transfered data contains actigraphy, then defined actigraphy metrics should also be filled on RedCap automaticaly.

Important Sending data for the same subject/visit will overwrite data on server, so crosscheck the validity of Id.

If you don't see subject's data on raw storage or in RedCap, check logs folder.

Creating sleep journal

When loading actigraphy data you can add a sleep journal (in xlsx format based on template)

App will compile it into actimetry format (.tsv), that you can then review by clicking on Inspect. A new window will open showing the double plot of actigraphy with superposed sleep stages.

The list of stages relevant for the selected day will be shown on the right, with start and end times relative to the chosen day.

You can edit, remove or add new entries by right-clicking on the table.

Save changes before changing the day.

Important as actimeters are sent by post, you need to add a NOWEAR interval from when participant removed actimeter to the end of recording. All metrics will be calculated based on the NOWEAR mask.

Once journal is saved, it will be reopened automatically if you load the same actigraphy file later, so you can edit jornal in several sessions.

To install/run not in app version

In order to run in editable mode, you should install qt6 and python3.10.

Once done, create an virtual environment, and clone the project. Then run pip install -e . in the root directory of project.

To launch, you need to compile the resources, run ARCactigraphy/recompile.sh.

You may change the path to the rcc utility (on mac it should be somwhere in /opt/homebrew/opt/qt), and also on mac sed don't work with -i for some reason. The import line in resources.py must be changed manually to from PyQt6

To compile into standalone app, pyinstaller must be installed, then run based on build.sh script. Mac and linux have different options.

To compile resources

1. Resources definition file. All paths are defined from resource file

<!DOCTYPE RCC>
<RCC version="1.0">
  <qresource prefix="icons">
      <file alias="older-horizontal.png">icons/icons/folder-horizontal.png</file>
  </qresource>
</RCC>

2. Compilation of resources

/usr/lib/qt6/rcc -g python resources.qrc -o resources.py

3. Importing resources in code

The prefix icons is used as "path" to alias.

import resources

QIcon(":/icons/folder-horizontal.png")

The data is included into resources as compiled binary data, and so no need to include the original unpacked resources.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors