技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
image-core【数据与研究】Create, read, write, inspect, clone, index, compare, and validate ANTsPy ANTsImage objects while preserving physical-space metadata.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a task is about the ants.ANTsImage lifecycle: constructing images from NumPy arrays, reading or writing image files, inspecting pixel type and physical metadata, cloning or casting images, indexing image data, comparing image values, checking physical-space consistency, or using packaged ANTsPy fixture data.
import ants; the package distribution is antspyx.antspyx installed.ANTsImage stores voxel values plus physical-space metadata: origin, spacing, direction, dimension, pixeltype, dtype, shape, components, and RGB/vector flags.img.numpy() returns a copy; editing it does not mutate the image. img.view() returns shared memory; editing it mutates the image.ants.from_numpy(array) uses default physical metadata unless origin, spacing, and direction are passed. Prefer img.new_image_like(array) or ants.from_numpy_like(array, img) for metadata-preserving array transforms.ants.image_physical_space_consistency(a, b); use datatype=True when pixel type and component count must also match.ants.allclose(a, b) compares voxel arrays only and does not prove matching physical metadata.unsigned char, unsigned int, float, and double; NumPy names map to uint8, uint32, float32, and float64 with constructor caveats in API reference.iMath, morphology, cropping/padding, denoising, and resampling details: image-ops-math.ants.ANTsTransform, ants.create_ants_transform, ants.read_transform, and ants.write_transform are mentioned here only to distinguish image metadata from transform objects. Use registration-transforms for transform construction, application, composition, inversion, or registration output handling.merge_channels, split_channels, rgb_to_vector, and vector_to_rgb are core enough for diagnosing vector/RGB ANTsImage shape and component semantics; display-oriented RGB workflows route to visualization/interop.