Skip to main content

motionSegmentation

Explicit spatio-temporal regularization of motion tracking1 using registered vector maps from SimpleElastix2

Installation

If your default python is python3: pip install motionSegmentation

Usage

simpleSolver(savePath,startstep=1,endstep=7,fileScale=None,getCompoundTimeList=None,compoundSchemeList=None,fftLagrangian=True,pngFileFormat=None,period=None,maskImg=True,anchor=None,peroid=None,bgrid=4.,finalShape=None,fourierTerms=4,twoD=False)

REQUIRED FILES

savePath+'/scale.txt': the length per pixel x, y, z of the image

OPTIONAL FILES

savePath+'/diastole_systole.txt': diastole and systolic time frame savePath+'/transform/manual_t{0:d}to{1:d}_0.txt'.format(anchor[n][0],anchor[n][1]): additional bspline vectors to support the motion estimation

savePath

set the folder path to be used where the generated and required files will be are.

startstep, endstep

Set the start and end step for the simpleSolver.

step 1: load image -- Image will be loaded as savePath+'/'+pngFileFormat.format(t,z)

step 2: create mask

step 3: Registrations

step 4: initialize BSF using fft

step 5: solve BSF

step 6: regrid to time

setp 7: compute compound

fileScale

set based on the scale of image dimension such that fileScale*AVERAGE_IMAGE_DIMENSION > 1

getCompoundTimeList,

set the timestep(s) for compounding in a list, if None, it will use diastolic and systolic timesteps in savePath+'/diastole_systole.txt', if file does not exist, it will be set as [0]

compoundSchemeList

set the compounding method(s) to use in a list, if None it will be set for all the supported compounding methods ['SAC','maximum','mean','wavelet']

fftLagrangian

Set to False if you do not want to use time frame 0 as reference (t -> t+1 and 0 -> t will be registered), then t -> t+1 and t -> t-1 will be registered.

pngFileFormat

set the string format to read and stacked multiple images, if None, defaults to 'time{0:03d}/slice{{0:03d}}time{0:03d}.png' for 3D and 'time{0:03d}.png' for 2D.

period

Set the period of the motion in time frame (can be a float), if None, it will default as the len(DIMENSION t)

maskImg

if True, it will auto detect and mask borders with 0 intensity

anchor

set as a List of pairs of time frame to include in the motion estimation in addition to the default: [[anchor_t_n1,anchor_t_m1],[anchor_t_n2,anchor_t_m2],...]

It will find the bspline files in savePath+'/transform/manual_t{0:d}to{1:d}_0.txt'.format(anchor[n][0],anchor[n][1]) for each pair

bgrid

set the spacing of the uniform bspline grid use to represent the image registration in terms of pixels of the largest dimension

fourierTerms

Number of Fourier terms, number of Fourier coefficients = Fourier terms*2+1

finalShape

Set the final uniform bspline grid shape (NUMBER OF CONTROL POINTS IN x,NUMBER OF CONTROL POINTS IN y,NUMBER OF CONTROL POINTS IN z,NUMBER FOURIER COEFFICIENTS PER CONTROL POINT, NUMBER OF DIMENSIONS), if None, it will default to the shape in t0 -> t1 registration.

twoD

set to True is the image set is in 2D

References

1 Wiputra, H., Chan, W. X., Foo, Y. Y., Ho, S., & Yap, C. H. (2020). Cardiac motion estimation from medical images: a regularisation framework applied on pairwise image registration displacement fields. Scientific reports, 10(1), 1-14.

2 Bradley Lowekamp, ., gabehart, ., Daniel Blezek, ., Luis Ibanez, ., Matt McCormick, ., Dave Chen, ., … Brad King, . (2015, June 26). SimpleElastix: SimpleElastix v0.9.0 (Version v0.9.0-SimpleElastix). Zenodo. http://doi.org/10.5281/zenodo.19049

Metadata

Release files for motionSegmentation 2.9.2

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

Source distribution (sdist)

Source distribution for motionSegmentation 2.9.2
File Size Uploaded
motionsegmentation-2.9.2.tar.gz 55.2 kB Details

Built distribution (wheel)

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

Total release size: 110.4 kB

Release files / motionsegmentation-2.9.2.tar.gz

Download URL motionsegmentation-2.9.2.tar.gz
Size 55.2 kB
Tags Source
SHA-256 checksum
How to use checksums
98cd9a164540092d9a138f497bd4513c979d5d83f763c07764249fe959b7e01e
BLAKE2b-256 checksum
How to use checksums
c2de6fd1c9c6ae8c10a9e9badda0168ccf22db42cf50de4d0be84c6e1847be02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.5

Release files / motionSegmentation-2.9.2-py3-none-any.whl

Download URL motionSegmentation-2.9.2-py3-none-any.whl
Size 55.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a32de23083d64af74e4bb3df5232afb67bf1ffeb62ac00c14c90976f444917c
BLAKE2b-256 checksum
How to use checksums
8505ad86666569906b13c72583ef1d47e82a03e38db2aedc58d99dd3654a6e11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.5

Release history Release notifications | RSS feed

This release

2.9.2 This release

2 release files

2.9.1

2 release files

2.9.0

2 release files

2.8.8

2 release files

2.8.7

2 release files

2.8.5

2 release files

2.8.4

2 release files

2.8.3

1 release file

2.8.2

2 release files

2.8.1

2 release files

2.8.0

2 release files

2.7.19

2 release files

2.7.18

2 release files

2.7.17

2 release files

2.7.16

2 release files

2.7.14

2 release files

2.7.12

1 release file

2.7.11

1 release file

2.7.10

1 release file

2.7.9

1 release file

2.7.8

1 release file

2.7.7

1 release file

2.7.6

1 release file

2.7.5

1 release file

2.7.4

1 release file

2.7.3

1 release file

2.7.2

1 release file

2.7.1

1 release file

2.7.0

1 release file

2.6.3

1 release file

2.6.2

1 release file

2.6.1

1 release file

2.6.0

1 release file

2.5.10

1 release file

2.5.9

1 release file

2.5.8

1 release file

2.5.7

1 release file

2.5.6

1 release file

2.5.5

1 release file

2.5.4

1 release file

2.5.3

1 release file

2.5.2

1 release file

2.5.1

1 release file

2.5.0

1 release file

2.4.7

1 release file

2.4.6

1 release file

2.4.5

1 release file

2.4.4

1 release file

2.4.3

1 release file

2.4.2

1 release file

2.4.1

1 release file

2.4.0

1 release file

2.3.3

1 release file

2.3.2

1 release file

2.3.1

1 release file

2.3.0

1 release file

2.2.7

1 release file

2.2.6

1 release file

2.2.5

1 release file

2.2.4

1 release file

2.2.3

1 release file

2.2.2

1 release file

2.2.1

1 release file

2.2.0

1 release file

2.1.0

1 release file

2.0.0

1 release file

1.2.0

1 release file

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