Skip to main content

curvanato

local curvature quantification for anatomical data

Installation & Testing

To install the package locally, navigate to the package root and run:

python3 -m pip install curvanato 

if you want to see some examples of different things the package can do, clone the source package and investigate the contents of the tests directory.

Usage

import ants
import antspynet
import antspyt1w
import curvanato
import re
import os  # For checking file existence
import pandas as pd
import numpy as np
os.environ["ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS"] = "32"
ctype='fs'
tcaudR=curvanato.load_labeled_caudate( option='hmt', binarize=False, label=[2,4,6] )
caudseg=curvanato.load_labeled_caudate( option=ctype )
# this step is important - fs caudate segmentations look pretty terrible in comparison to what i am used to ....
caudseg=ants.threshold_image( caudseg, 50, 50 ).resample_image( [0.5,0.5,0.5], interp_type=0 ).threshold_image(0.5,1)
fn='/tmp/cc_example.nii.gz'
vlab=None
gr=0
subd=0
ccfn = [
        re.sub( ".nii.gz", "_"+ctype+"Rkappa.nii.gz" , fn ), 
        re.sub( ".nii.gz", "_"+ctype+"R.nii.gz" , fn ),
        re.sub( ".nii.gz", "_"+ctype+"Rthk.nii.gz" , fn ),
        re.sub( ".nii.gz", "_"+ctype+"Rkappa.csv" , fn ),
        re.sub( ".nii.gz", "_"+ctype+"Rkappa.png" , fn ),
        re.sub( ".nii.gz", "_"+ctype+"Rthk.png" , fn ) ]
pcaud=[3,4]
plabs=[4]
mytl=1
xx = curvanato.t1w_caudcurv(  caudseg, target_label=mytl, ventricle_label=vlab, 
        prior_labels=pcaud, prior_target_label=plabs, subdivide=subd, grid=gr,
        priorparcellation=tcaudR,  plot=True, smoothing=0.5,
        verbose=True )
ants.plot( xx[0], xx[1], crop=True, axis=2, nslices=21, ncol=7, filename=ccfn[4] )
ants.plot( xx[0], xx[2], crop=True, axis=2, nslices=21, ncol=7, filename=ccfn[5] )
for j in range(3):
    ants.image_write( xx[j], ccfn[j] )
xx[3].to_csv( ccfn[3] )

Example data

this package has been tested on ANTPD data from openneuro.

could also try data here which included repeated T1w acquisitions on same subjects but with different parameters. however, last time i tried this, the link was not working.

rm -r -f build/ curvanato.egg-info/ dist/
python3 -m  build .
python3 -m pip install --upgrade twine
python3 -m twine upload --repository curvanato dist/*

Metadata

Release files for curvanato 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for curvanato 1.2.0
File Size Uploaded
curvanato-1.2.0.tar.gz 91.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for curvanato 1.2.0
File Interpreter ABI Platform
curvanato-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 176.3 kB

Release files / curvanato-1.2.0.tar.gz

Download URL curvanato-1.2.0.tar.gz
Size 91.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6351fff497326325c6c41af17657462c18c4c14abbd96f1f7fd8acded713c32d
BLAKE2b-256 checksum
How to use checksums
61b7f255229db22a9bb914194b919f62077a22386b3aa704dbde5fd7b693c5f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.9

Release files / curvanato-1.2.0-py3-none-any.whl

Download URL curvanato-1.2.0-py3-none-any.whl
Size 84.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a818bd13ddb66854198c8764f8f1d7749d727cfbbfe9a0c77653eaf63a60105
BLAKE2b-256 checksum
How to use checksums
5a0b48d6c7c36aa81c74edc0e5b364df94e25889167fa2c661673d1d87159ed4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.9

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.0.0

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page