semvec/pypi-packages huggingface dataset:
nifti-snapshot 0.1.20
First release to test pypi
Requires Python: >=3.7
Keywords: nifti,snapshot

![icon](docs/source/images/icon_resize.png) 

# nifti-snapshot

`nifti-snapshot` is a tool to quickly capture nifti image as a `png` or
`jpeg` figures.


```sh
$ pip install nifti_snapshot
```

For full documentation: [Here](https://nifti-snapshot.readthedocs.io/en/latest/)


## TBSS figures

### From commandline

#### Snapshot of an `tbss_fill` image

```sh
fw=tbss_FW_tfce_corrp_tstat2_filled.nii.gz

./nifti_snapshot \
    --input ${fw} \
    --tbss \
    --output_file cli_test_fw.png \
    --cmap "Blues_r" \
    --title "Significant changes in FW in group A" \
    --cbar_title 'Increased FW' 
```

![output](docs/fw_example.png)


<br>

#### Snapshot of two `tbss_fill` images with overlap highlight

```shell
fa=tbss_FA_tfce_corrp_tstat1_filled.nii.gz
fat=tbss_FAt_tfce_corrp_tstat1_filled.nii.gz

./nifti_snapshot \
    --input ${fa} ${fat} \
    --tbss \
    --output_file cli_test.png \
    --cmap "Blues_r" "autumn" \
    --title "Significant changes in FA and FAt in group A" \
    --cbar_title 'Reduced' 'Reduced FAt' 'Overlap' \
    --overlap \
    --overlap_cmap "summer" \
    --overlap_alpha 0.8
```

![output](docs/fa_fat_example.png)



---


### From python

#### Snapshot of an `tbss_fill` image

```py
from nifti_snapshot import nifti_snapshot
fw = 'tbss_FA_tfce_corrp_tstat1_filled.nii.gz'
fw_color = 'Blues_r'

tbssFigure = nifti_snapshot.TbssFigure(
        image_files=[fw],
        output_file='docs/fw_example.png',
        cmap_list=[fw_color],
        cbar_titles=['Increased FW'],
        alpha_list=[0.8],
        title='Increased Freewater in group A',
        cbar_x=0.35, cbar_width=0.3)
tbssFigure.create_figure_one_map()
```

#### Snapshot of two `tbss_fill` images with overlap highlight

```py
from nifti_snapshot import nifti_snapshot
fa = 'tbss_FA_tfce_corrp_tstat1_filled.nii.gz'
fat = 'tbss_FAt_tfce_corrp_tstat1_filled.nii.gz'

fa_color_1 = 'Blues_r'
fa_color_2 = 'autumn'
fa_color_overlap = 'summer'

tbssFigure = nifti_snapshot.TbssFigure(
    image_files=[fa, fat],
    output_file='docs/fa_fat_example.png',
    cmap_list=[fa_color_1, fa_color_2],
    overlap_cmap=fa_color_overlap,
    cbar_titles=[
        'Reduced FA',
        'Reduced FAt',
        'Overlap'],
    alpha_list=[1, 1, 0.8],
    title='Significant changes in FA and FAt in group A')
tbssFigure.create_figure_two_maps_and_overlap()
```
oitei 1.1.1
OpenITI mARkdown to TEI converter
Requires Python: >=3.8

# oitei: OpenITI TEI Converter

This Python library converts an [OpenITI mARkdown](https://alraqmiyyat.github.io/mARkdown/) document and returns a TEI-XML string based on the [OpenITI TEI Schema](https://openiti.github.io/tei_openiti/tei_openiti.html).

## Installation

Set up a virtual environment with `venv`

```py
python3 -m venv .env
```

Activate the virtual environment

```py
source .env/bin/activate
```

Install

```py
python setup.py install
```

## Usage

```py
import oitei
md = open("markdown.md", "r").read()
md.close()
tei_string = oitei.convert(md).tostring() # or just cast to string with str()
with open('tei.xml', 'w') as writer:
    writer.write(tei_string)
```


## Coverage

This converter is based on the [OpenITI mARkdown Parser](https://openiti.github.io/oimdp/oimdp.structures.html), which covers the mARkdown specification.

The most common structures are currently converted to TEI, but other less common ones are still missing:

* MorphologicalPattern
* OpenTagAuto
* OpenTagUser
* RouteDist
* RouteFrom
* RouteTowa

There are also plans to convert to TEI YAML metadata provided with mARkdown files in the OpenITI corpus.
image_segmenter 0.2.1
Image Segmenter

# ImageSegmenter

This Python package provides a class `ImageSegmenter` for annotating images with bounding boxes using various image processing techniques. 

## Table of Contents

- [Background](#background)
- [Installation](#installation)
- [Usage](#usage)
- [Support](#support)
- [Contributing](#contributing)

## Background

Image segmentation and annotation is a crucial part of any machine learning project that deals with images. The `ImageSegmenter` class provided in this package simplifies this process. It uses various image processing techniques like morphological operations, thresholding, and channel selection to help generate accurate bounding boxes. It also includes the ability to visualize the results, save the annotations, and apply various filters.

## Installation

The `ImageSegmenter` package requires:

- OpenCV
- NumPy
- Matplotlib
- VOCWriter (For saving annotations)

To install these dependencies, you can use pip:

```bash
pip install opencv-python numpy matplotlib voc-writer
```

To use the `ImageSegmenter` class, simply include it in your Python script:

```python
from image_segmenter import ImageSegmenter
```

## Usage

Here's an example usage of the `ImageSegmenter` class:

```python
from image_segmenter import ImageSegmenter

# Instantiate the ImageSegmenter
annotator = ImageSegmenter()

# Read an image
image = annotator.read_image('path_to_image')

# Convert to grayscale
image_gray = annotator.select_colorsp(image, 'gray')

# Apply thresholding
thresholded = annotator.threshold(image_gray)

# Apply morphological operations
morphed = annotator.morph_op(thresholded, 'open')

# Find contours
bboxes = annotator.get_bboxes(morphed)

# Visualize the results #
#########################

# draw bounding boxes
annotated = annotator.draw_bboxes(image, bboxes)

# show the image
annotator.display_image(image, annotated)

#########################

# Save the annotations
annotator.save_annotations('path_to_save_annotations', image, bboxes)
```

## TODO
- Write tests
- add multi-label support
- add support for other image formats
- add support for other image processing techniques
- add support for other annotation formats


# Special Thanks
A special thanks to **Kukil**, the author of [this guide](https://learnopencv.com/automated-image-annotation-tool-using-opencv-python/) from which these methods were generated