btpytools


Namebtpytools JSON
Version 0.1.37 PyPI version JSON
download
home_pageNone
SummaryHelper functions for BakingTray and StitchIt
upload_time2024-05-03 13:30:05
maintainerNone
docs_urlNone
authorRob Campbell
requires_python>=3.9.0
licenseGPL-3.0-or-later
keywords anatomy image analysis data handling
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # StitchIt Python Tools

[![PyPI](https://img.shields.io/pypi/v/btpytools.svg?color=green)](https://pypi.org/project/btpytools)
[![Python Version](https://img.shields.io/pypi/pyversions/btpytools.svg?color=green)](https://python.org)
[![License GNU GPL v3.0](https://img.shields.io/pypi/l/btpytools.svg?color=green)](https://github.com/SWC-Advanced-Microscopy/btpytools/raw/main/LICENSE)


This package contains Python code for managing BakingTray serial-section 2p data.
The main functions of interest are `compressRawData.py` and `transferToServer.py`, which are aimed at end users of the microscope. 
The `recipe.py` and `tools.py` modules support these and are aimed at developers. 



## Install instructions
If you wish to use the data management tools and do not care about the `brainreg` helper tool:
```
$ pip install btpytools

```

You will then be able to run the following commands at the system command prompt:


* `transferToServer`
* `compressRawData`
* `summariseAcqs`

If you also want the `brainreg` helper command `brainregbt` (see below) then install with 
```
$ pip install btpytools[register]

```
This will also install brainreg and all of its dependencies, which are many. 

### To build with "register" option on Apple Silicon
For `$ pip install btpytools[register]` to succeed on Apple Silicon you will first have to:

```
pip install cython
brew install hdf5 c-blosc
export HDF5_DIR=/opt/homebrew/opt/hdf5 
export BLOSC_DIR=/opt/homebrew/opt/c-blosc
```


## Usage instructions

### Compressing the raw data directory
`cd` to the sample directory at the command line and run `compressRawData`. This works much faster
if you to have installed `lbzip2`, which runs parallel bzip. Likely only works on Linux. The
command also confirms there is enough disk space available to complete successfully.

```
$ cd /mnt/data/BakingTrayStacks/CC_125_1__125_2/ 
$ compressRawData  
```

### Sending data to a remote server
The server should be mounted locally to a mount point writable by the user. The tranfer is via `rsync`. The command just ensures no uncompressed raw data or uncropped stacks are copied. It brute-force retries if there is a failure for some reason. 

First `cd` to the directory which **contains your samples**. Not the sample directory. e.g.
```
$ cd /mnt/data/BakingTrayStacks
```

You can now run in either of the following two ways (either one acquisition or multiple acquisitions)
```
$ transferToServer RC_RabiesBrains01 /mnt/server/user/data/histology
$ transferToServer RC_RabiesBrains01 RC_TwoProbeTracks_test RC_MyOldSample /mnt/server/user/data/histology
```

**NOTE**: If `RC_RabiesBrains01`  contains a compressed raw data archive, the following will **not** transfer it:
```
$ transferToServer RC_RabiesBrains01/sample01 RC_RabiesBrains01/sample02 /mnt/server/user/data/histology
```

If the transfer completed successfully, the command creates an empty filed called `TRANSFER_SUCCEEDED` in the local directory (or directories). This file is not copied to the server. 


### Wrapper for brainreg with BakingTray data
With this package installed and also brainreg installed you can run registrations with super easily at the command line using the downsampled stacks generated by StitchIt.

* `cd` to a BakingTray sample directory
* Run `brainregbt`


Sample session
```
$ brainregbt
Select downsampled stack voxel size for registration.
(Enter a number and press return)
1. 25 micron
2. 50 micron

[1] ?
Choose channel for registration.
1. red channel
2. green channel

[1] ?


Registering data for sample SM_1099839 with 50 micron downsampled red stack.
Press return to start
```

Running `brainregbt -D` will run the registration with the above defaults. Available resolutions depend on which downsampled stacks were generated by StitchIt.


## Developer notes
Create and activate a fresh conda environment and install with:
```
$ pip install btpytools[dev]
```

You can now `cd` to the project root directory and do the following.

* Static code analysis: `mypy btpytools`
* Run pre-commit operations with the command `pre-commit`
* Run `black` to re-format files using `black ./`


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "btpytools",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9.0",
    "maintainer_email": null,
    "keywords": "anatomy, image analysis, data handling",
    "author": "Rob Campbell",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/35/45/b9809661adf33751d7a050e27b692339ac65045b672234738357931add15/btpytools-0.1.37.tar.gz",
    "platform": null,
    "description": "# StitchIt Python Tools\n\n[![PyPI](https://img.shields.io/pypi/v/btpytools.svg?color=green)](https://pypi.org/project/btpytools)\n[![Python Version](https://img.shields.io/pypi/pyversions/btpytools.svg?color=green)](https://python.org)\n[![License GNU GPL v3.0](https://img.shields.io/pypi/l/btpytools.svg?color=green)](https://github.com/SWC-Advanced-Microscopy/btpytools/raw/main/LICENSE)\n\n\nThis package contains Python code for managing BakingTray serial-section 2p data.\nThe main functions of interest are `compressRawData.py` and `transferToServer.py`, which are aimed at end users of the microscope. \nThe `recipe.py` and `tools.py` modules support these and are aimed at developers. \n\n\n\n## Install instructions\nIf you wish to use the data management tools and do not care about the `brainreg` helper tool:\n```\n$ pip install btpytools\n\n```\n\nYou will then be able to run the following commands at the system command prompt:\n\n\n* `transferToServer`\n* `compressRawData`\n* `summariseAcqs`\n\nIf you also want the `brainreg` helper command `brainregbt` (see below) then install with \n```\n$ pip install btpytools[register]\n\n```\nThis will also install brainreg and all of its dependencies, which are many. \n\n### To build with \"register\" option on Apple Silicon\nFor `$ pip install btpytools[register]` to succeed on Apple Silicon you will first have to:\n\n```\npip install cython\nbrew install hdf5 c-blosc\nexport HDF5_DIR=/opt/homebrew/opt/hdf5 \nexport BLOSC_DIR=/opt/homebrew/opt/c-blosc\n```\n\n\n## Usage instructions\n\n### Compressing the raw data directory\n`cd` to the sample directory at the command line and run `compressRawData`. This works much faster\nif you to have installed `lbzip2`, which runs parallel bzip. Likely only works on Linux. The\ncommand also confirms there is enough disk space available to complete successfully.\n\n```\n$ cd /mnt/data/BakingTrayStacks/CC_125_1__125_2/ \n$ compressRawData  \n```\n\n### Sending data to a remote server\nThe server should be mounted locally to a mount point writable by the user. The tranfer is via `rsync`. The command just ensures no uncompressed raw data or uncropped stacks are copied. It brute-force retries if there is a failure for some reason. \n\nFirst `cd` to the directory which **contains your samples**. Not the sample directory. e.g.\n```\n$ cd /mnt/data/BakingTrayStacks\n```\n\nYou can now run in either of the following two ways (either one acquisition or multiple acquisitions)\n```\n$ transferToServer RC_RabiesBrains01 /mnt/server/user/data/histology\n$ transferToServer RC_RabiesBrains01 RC_TwoProbeTracks_test RC_MyOldSample /mnt/server/user/data/histology\n```\n\n**NOTE**: If `RC_RabiesBrains01`  contains a compressed raw data archive, the following will **not** transfer it:\n```\n$ transferToServer RC_RabiesBrains01/sample01 RC_RabiesBrains01/sample02 /mnt/server/user/data/histology\n```\n\nIf the transfer completed successfully, the command creates an empty filed called `TRANSFER_SUCCEEDED` in the local directory (or directories). This file is not copied to the server. \n\n\n### Wrapper for brainreg with BakingTray data\nWith this package installed and also brainreg installed you can run registrations with super easily at the command line using the downsampled stacks generated by StitchIt.\n\n* `cd` to a BakingTray sample directory\n* Run `brainregbt`\n\n\nSample session\n```\n$ brainregbt\nSelect downsampled stack voxel size for registration.\n(Enter a number and press return)\n1. 25 micron\n2. 50 micron\n\n[1] ?\nChoose channel for registration.\n1. red channel\n2. green channel\n\n[1] ?\n\n\nRegistering data for sample SM_1099839 with 50 micron downsampled red stack.\nPress return to start\n```\n\nRunning `brainregbt -D` will run the registration with the above defaults. Available resolutions depend on which downsampled stacks were generated by StitchIt.\n\n\n## Developer notes\nCreate and activate a fresh conda environment and install with:\n```\n$ pip install btpytools[dev]\n```\n\nYou can now `cd` to the project root directory and do the following.\n\n* Static code analysis: `mypy btpytools`\n* Run pre-commit operations with the command `pre-commit`\n* Run `black` to re-format files using `black ./`\n\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-or-later",
    "summary": "Helper functions for BakingTray and StitchIt",
    "version": "0.1.37",
    "project_urls": {
        "repository": "https://github.com/SWC-Advanced-Microscopy/btpytools"
    },
    "split_keywords": [
        "anatomy",
        " image analysis",
        " data handling"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3d47d2dc04bd014a1f96a4e0e660efd08f480964af87d15a692ccda7178d8c31",
                "md5": "c7e46ae5be6953541ecc2db95e1ae18d",
                "sha256": "d66e00de0fa23baf1eaab7d22d9fb3dcb3112e7f4d2d0fb54496144c02854dc9"
            },
            "downloads": -1,
            "filename": "btpytools-0.1.37-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c7e46ae5be6953541ecc2db95e1ae18d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9.0",
            "size": 35205,
            "upload_time": "2024-05-03T13:30:03",
            "upload_time_iso_8601": "2024-05-03T13:30:03.036107Z",
            "url": "https://files.pythonhosted.org/packages/3d/47/d2dc04bd014a1f96a4e0e660efd08f480964af87d15a692ccda7178d8c31/btpytools-0.1.37-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3545b9809661adf33751d7a050e27b692339ac65045b672234738357931add15",
                "md5": "193a562430555da313eca7ca83b53a6d",
                "sha256": "d2e958da48f04ffe4d406e074b5778ba078f503887aad566486cd9dbe9421c5a"
            },
            "downloads": -1,
            "filename": "btpytools-0.1.37.tar.gz",
            "has_sig": false,
            "md5_digest": "193a562430555da313eca7ca83b53a6d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9.0",
            "size": 161770,
            "upload_time": "2024-05-03T13:30:05",
            "upload_time_iso_8601": "2024-05-03T13:30:05.034121Z",
            "url": "https://files.pythonhosted.org/packages/35/45/b9809661adf33751d7a050e27b692339ac65045b672234738357931add15/btpytools-0.1.37.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-03 13:30:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SWC-Advanced-Microscopy",
    "github_project": "btpytools",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "btpytools"
}
        
Elapsed time: 0.28120s