radstract

Lint & Test codecov

Radstract

Radstract is python library containing shared code for RadOSS projects.

It has a range of subpackages for different tasks:

  • Data: For data/image manipulation and conversion functions
  • Analysis: For different methods of analyzing the data, from nifti and dicom files
  • Math: For different mathematical functions and operations
  • Datasets: for converting and working with different datasets (Huggingface etc)

Feel free to use this code in your own projects, and if you have any questions or suggestions, please feel free to open an issue.

Installation

pip install git+https://github.com/radoss-org/radstract.git

See examples here for a quickstart: https://github.com/radoss-org/Radstract/tree/main/examples

Docs

Docs can be viewed at https://radoss-org.github.io/radstract/radstract.html

Examples

See examples here: https://github.com/radoss-org/Radstract/tree/main/examples

Developer Guide

You can clone the repository and install the dependencies with the following command:

git clone https://github.com/radoss-org/radstract.git

You can then install retuve with poetry, and then run the tests:

# Needed for the scripts
pip install poethepoet

cd retuve
poetry install

# Generate the test data
poe testgen

# Run all tests, including examples.
poe test_all

# Get info on all other dev scripts
poe help

Acknowledgments

Data for the examples and tests is from https://github.com/radoss-org/radoss-creative-commons.

Please see this repo for attribution and licensing information.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

 1# Copyright 2024 Adam McArthur
 2#
 3# Licensed under the Apache License, Version 2.0 (the "License");
 4# you may not use this file except in compliance with the License.
 5# You may obtain a copy of the License at
 6#
 7#     http://www.apache.org/licenses/LICENSE-2.0
 8#
 9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15"""
16.. include:: ../README.md
17"""
18
19import logging
20
21
22class _TileNumberFilter(logging.Filter):
23    def filter(self, record):
24        return "tile number" not in record.getMessage()
25
26
27_logger = logging.getLogger("openjpeg.encode")
28_logger.addFilter(_TileNumberFilter())