Skip to content

Commit

Permalink
Merge pull request #533 from ANTsX/explicit-inits
Browse files Browse the repository at this point in the history
Explicit imports
  • Loading branch information
Nick Cullen authored Feb 16, 2024
2 parents 445c7f5 + 39831bb commit 2ed8e52
Show file tree
Hide file tree
Showing 10 changed files with 203 additions and 80 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/stnava/ANTsPyDocker/master)
[![PubMed](https://img.shields.io/badge/ANTsX_paper-Open_Access-8DABFF?logo=pubmed)](https://pubmed.ncbi.nlm.nih.gov/33907199/)


## About ANTsPy


Search [ANTsPy documentation at read the docs.](https://antspyx.readthedocs.io/en/latest/?badge=latest)

<i>ANTsPy</i> is a Python library which wraps the C++ biomedical image processing library <i>[ANTs](https://github.com/ANTsX/ANTs)</i>,
Expand Down
2 changes: 1 addition & 1 deletion ants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
from .learn import *
from .viz import *

from . import contrib
from . import contrib
69 changes: 63 additions & 6 deletions ants/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,66 @@

from .ants_image import *
from .ants_image_io import *
from .ants_image_io import (
image_header_info,
image_clone,
image_read,
dicom_read,
image_write,
make_image,
matrix_to_images,
images_from_matrix,
image_list_to_matrix,
images_to_matrix,
matrix_from_images,
timeseries_to_matrix,
matrix_to_timeseries,
from_numpy,
_from_numpy
)

from .ants_image import (
ANTsImage,
LabelImage,
copy_image_info,
set_origin,
get_origin,
set_direction,
get_direction,
set_spacing,
get_spacing,
image_physical_space_consistency,
image_type_cast,
allclose
)

from .ants_metric_io import (
new_ants_metric,
create_ants_metric,
supported_metrics
)

from .ants_transform_io import (
create_ants_transform,
new_ants_transform,
read_transform,
write_transform,
transform_from_displacement_field,
transform_to_displacement_field
)

from .ants_transform import (
ANTsTransform,
set_ants_transform_parameters,
get_ants_transform_parameters,
get_ants_transform_fixed_parameters,
set_ants_transform_fixed_parameters,
apply_ants_transform,
apply_ants_transform_to_point,
apply_ants_transform_to_vector,
apply_ants_transform_to_image,
invert_ants_transform,
compose_ants_transforms,
transform_index_to_physical_point,
transform_physical_point_to_index
)

from .ants_transform import *
from .ants_transform_io import *

from .ants_metric import *
from .ants_metric_io import *
6 changes: 5 additions & 1 deletion ants/learn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@

from .decomposition import *
from .decomposition import (
eig_seg,
initialize_eigenanatomy,
sparse_decom2
)
30 changes: 17 additions & 13 deletions ants/registration/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@


from .affine_initializer import *
from .apply_transforms import *
from .affine_initializer import affine_initializer
from .apply_transforms import (apply_transforms,apply_transforms_to_points)
from .create_jacobian_determinant_image import create_jacobian_determinant_image
from .create_jacobian_determinant_image import deformation_gradient
from .create_warped_grid import *
from .fsl2antstransform import *
from .make_points_image import *
from .metrics import *
from .reflect_image import *
from .reorient_image import *
from .resample_image import *
from .symmetrize_image import *
from .build_template import *
from .landmark_transforms import *
from .create_warped_grid import create_warped_grid
from .fsl2antstransform import fsl2antstransform
from .make_points_image import make_points_image
from .metrics import image_mutual_information
from .reflect_image import reflect_image
from .reorient_image import (get_orientation,
reorient_image2,
get_possible_orientations,
get_center_of_mass)
from .resample_image import (resample_image,
resample_image_to_target)
from .symmetrize_image import symmetrize_image
from .build_template import build_template
from .landmark_transforms import (fit_transform_to_paired_points, fit_time_varying_transform_to_point_sets)

from .interface import *
from .interface import (registration, motion_correction)
21 changes: 10 additions & 11 deletions ants/segmentation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from .anti_alias import *
from .atropos import *
from .kmeans import *
from .functional_lung_segmentation import *
from .fuzzy_spatial_cmeans_segmentation import *
from .kelly_kapowski import *
from .joint_label_fusion import joint_label_fusion
from .joint_label_fusion import local_joint_label_fusion
from .label_geometry_measures import *
from .otsu import *
from .prior_based_segmentation import *
from .anti_alias import anti_alias
from .atropos import atropos
from .kmeans import kmeans_segmentation
from .functional_lung_segmentation import functional_lung_segmentation
from .fuzzy_spatial_cmeans_segmentation import fuzzy_spatial_cmeans_segmentation
from .kelly_kapowski import kelly_kapowski
from .joint_label_fusion import joint_label_fusion, local_joint_label_fusion
from .label_geometry_measures import label_geometry_measures
from .otsu import otsu_segmentation
from .prior_based_segmentation import prior_based_segmentation
132 changes: 89 additions & 43 deletions ants/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,45 +1,91 @@
from .add_noise_to_image import *
from .bias_correction import *
from .channels import *
from .compose_displacement_fields import *
from .convert_nibabel import *
from .crop_image import *
from .denoise_image import *
from .fit_bspline_object_to_scattered_data import *
from .fit_bspline_displacement_field import *
from .fit_thin_plate_spline_displacement_field import *
from .get_ants_data import *
from .get_centroids import *
from .get_mask import *
from .get_neighborhood import *
from .histogram_match_image import *
from .hausdorff_distance import *
from .image_similarity import *
from .image_to_cluster_images import *
from .iMath import *
from .impute import *
from .integrate_velocity_field import *
from .invariant_image_similarity import *
from .invert_displacement_field import *
from .label_clusters import *
from .label_image_centroids import *
from .label_overlap_measures import *
from .label_stats import *
from .labels_to_matrix import *
from .mask_image import *
from .mni2tal import *
from .morphology import *
from .multi_label_morphology import *
from .ndimage_to_list import *
from .pad_image import *
from .process_args import *
from .quantile import *
from .scalar_rgb_vector import *
from .simulate_displacement_field import *
from .slice_image import *
from .smooth_image import *
from .threshold_image import *
from .weingarten_image_curvature import *
from .average_transform import *
from .add_noise_to_image import add_noise_to_image
from .bias_correction import (n3_bias_field_correction, n3_bias_field_correction2, n4_bias_field_correction, abp_n4)
from .channels import merge_channels, split_channels
from .compose_displacement_fields import compose_displacement_fields
from .convert_nibabel import (to_nibabel, from_nibabel, nifti_to_ants)
from .crop_image import (crop_image,
crop_indices,
decrop_image)
from .denoise_image import denoise_image
from .fit_bspline_object_to_scattered_data import fit_bspline_object_to_scattered_data
from .fit_bspline_displacement_field import fit_bspline_displacement_field
from .fit_thin_plate_spline_displacement_field import fit_thin_plate_spline_displacement_field
from .get_ants_data import (get_ants_data,
get_data)
from .get_centroids import get_centroids
from .get_mask import get_mask
from .get_neighborhood import (get_neighborhood_in_mask,
get_neighborhood_at_voxel)
from .histogram_match_image import histogram_match_image
from .hausdorff_distance import hausdorff_distance
from .image_similarity import image_similarity
from .image_to_cluster_images import image_to_cluster_images
from .iMath import (iMath,
image_math,
multiply_images,
iMath_get_largest_component,
iMath_normalize,
iMath_truncate_intensity,
iMath_sharpen,
iMath_pad,
iMath_maurer_distance,
iMath_perona_malik,
iMath_grad,
iMath_laplacian,
iMath_canny,
iMath_histogram_equalization,
iMath_MD,
iMath_ME,
iMath_MO,
iMath_MC,
iMath_GD,
iMath_GE,
iMath_GO,
iMath_GC,
iMath_fill_holes,
iMath_get_largest_component,
iMath_normalize,
iMath_truncate_intensity,
iMath_sharpen,
iMath_propagate_labels_through_mask)
from .impute import impute
from .integrate_velocity_field import integrate_velocity_field
from .invariant_image_similarity import (invariant_image_similarity,
convolve_image)
from .invert_displacement_field import invert_displacement_field
from .label_clusters import label_clusters
from .label_image_centroids import label_image_centroids
from .label_overlap_measures import label_overlap_measures
from .label_stats import label_stats
from .labels_to_matrix import labels_to_matrix
from .mask_image import mask_image
from .mni2tal import mni2tal
from .morphology import morphology
from .multi_label_morphology import multi_label_morphology
from .ndimage_to_list import (ndimage_to_list,
list_to_ndimage)
from .pad_image import pad_image
from .process_args import (
get_pointer_string,
short_ptype,
_ptrstr,
_int_antsProcessArguments,
get_lib_fn,
)
from .quantile import (ilr,
rank_intensity,
quantile,
regress_poly,
regress_components,
get_average_of_timeseries,
compcor,
bandpass_filter_matrix )
from .scalar_rgb_vector import (rgb_to_vector, vector_to_rgb, scalar_to_rgb)
from .simulate_displacement_field import simulate_displacement_field
from .slice_image import slice_image
from .smooth_image import smooth_image
from .threshold_image import threshold_image
from .weingarten_image_curvature import weingarten_image_curvature
from .average_transform import average_affine_transform, average_affine_transform_no_rigid
from .averaging import average_images

1 change: 1 addition & 0 deletions ants/utils/average_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from tempfile import mktemp
import os

__all__ = ['average_affine_transform', 'average_affine_transform_no_rigid']


def _average_affine_transform_driver(transformlist, referencetransform=None, funcname="AverageAffineTransform"):
Expand Down
1 change: 1 addition & 0 deletions ants/utils/averaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from ..core import ants_image_io as iio2
from .. import registration as reg

__all__ = ['average_images']
########################
def average_images( x, normalize=True, mask=None, imagetype=0, sum_image_threshold=3, return_sum_image=False, verbose=False ):
"""
Expand Down
19 changes: 14 additions & 5 deletions ants/viz/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
from .create_tiled_mosaic import *
from .plot import *
from .render_surface_function import *
from .surface import *
from .volume import *
from .create_tiled_mosaic import create_tiled_mosaic
from .plot import (
plot,
movie,
plot_hist,
plot_grid,
plot_ortho,
plot_ortho_double,
plot_ortho_stack,
plot_directory,
)
from .render_surface_function import render_surface_function
from .surface import (surf, surf_fold, surf_smooth, get_canonical_views)
from .volume import (vol, vol_fold)

0 comments on commit 2ed8e52

Please sign in to comment.