Skip to main content

Library for converting the CVSX file format into the MVSX file format

Project description

cvsx2mvsx

cvsx2mvsx is a Python library and CLI tool designed to convert CVSX archives into MVSX or MVStory formats.

Installation

pip install cvsx2mvsx

CLI Usage

Convert a CVSX file to an MVSX archive:

uvx cvsx2mvsx --input examples/emd-1832.cvsx --output output.mvsx --format mvsx

Convert a CVSX file to the MVStory format:

uvx cvsx2mvsx --input examples/emd-1832.cvsx --output output.mvstory --format mvstory

Lattice to Mesh Conversion

If your input CVSX contains Lattice segmentations (voxel masks) and you wish to convert them to meshes via Marching Cubes rather than keeping them as volumes:

uvx cvsx2mvsx --input examples/emd-1832.cvsx --output output.mvsx --lattice-to-mesh

Arguments

Argument Description Default
--input Path to the input .cvsx file. Required
--output Path to the output file (.mvsx or .mvstory). Required
--format Output format type (mvsx or mvstory). mvsx
--lattice-to-mesh Enable Marching Cubes conversion for lattice data. False

Python API Usage

MVSX Pipeline

To create an MVSX file, you define a pipeline that extracts, transforms to the internal model, transforms to MVSX state, and loads to disk.

# 1. Declare the pipeline structure
pipeline = Pipeline([
    ExtractCVSX(),
    TransformToInternal(),
    TransformToMVSX(),
    LoadMVSX()
])

# 2. Define run configuration
config = PipelineConfig(
      input_path="path/to/input.cvsx",
      output_path="path/to/output.mvsx",
      lattice_to_mesh=True,
)

# 3. Execute
pipeline.run(config)

MVStory Pipeline

To create a Story, simply swap the transformation and loading steps of the MVSX pipeline:

pipeline = Pipeline([
    ExtractCVSX(),
    TransformToInternal(),
    TransformToMVStory(),
    LoadMVStory()
])

config = PipelineConfig(
      input_path="path/to/input.cvsx",
      output_path="path/to/output.mvstory",
      lattice_to_mesh=True,
)


pipeline.run(config)

Architecture

The library follows a ETL (Extract, Transform, Load) Pipeline pattern.

Core Concepts

  1. Pipeline: A container that executes a list of steps sequentially. It manages the lifecycle of the process.
  2. Context: A shared state object passed between steps. It manages configuration, holds a temporary working directory for intermediate files, and cleans up resources automatically after execution.
  3. Steps: Discrete units of logic that implement a generic interface.

The Pipeline Flow

  1. Extract (ExtractCVSX):
    • Unzips the .cvsx archive into the pipeline context temp directory.
    • Parses index.json, metadata, and BinaryCIF files using ciftools.
  2. Transform (TransformToInternal):
    • Converts CVSX data into a normalized InternalEntry model.
    • Handles complex logic like Lattice-to-Mesh conversion (Marching Cubes).
  3. Transform (TransformToMVSX / TransformToMVStory):
    • Converts the InternalEntry into format-specific representations (MVSX or MVStory).
  4. Load (LoadMVSX / LoadMVStory):
    • Packages the processed assets and state into the final binary output file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cvsx2mvsx-1.0.0.tar.gz (211.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cvsx2mvsx-1.0.0-py3-none-any.whl (80.8 kB view details)

Uploaded Python 3

File details

Details for the file cvsx2mvsx-1.0.0.tar.gz.

File metadata

  • Download URL: cvsx2mvsx-1.0.0.tar.gz
  • Upload date:
  • Size: 211.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cvsx2mvsx-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f44e0892d8b88879b5521a2d3ebbe6f84b49fba12aff8c4d466627c88c7396b9
MD5 176d59dbcec09674b4ace485631b399a
BLAKE2b-256 27266fbcd737b97443d2f0c33cbaf6ec995cc8f95b9b40bf8b6f84b4c5b01629

See more details on using hashes here.

File details

Details for the file cvsx2mvsx-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: cvsx2mvsx-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 80.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cvsx2mvsx-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 471cc74954a74066e7dc1da9408a31e23b9026257d061e572aea5dccf98e15c7
MD5 7f1f2d669f25e84689e0914fcb20e285
BLAKE2b-256 17249756ee338669c07b9ae21f0b90f73c5cb504e96569b2d8be19859df39507

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page