https://github.com/cgohlke/cmapfile

Write Chimera Map (CMAP) files.

https://github.com/cgohlke/cmapfile

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 1 committers (100.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.6%) to scientific vocabulary

Keywords

chimera hdf5 image image-converter python
Last synced: 5 months ago · JSON representation

Repository

Write Chimera Map (CMAP) files.

Basic Info
Statistics
  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
chimera hdf5 image image-converter python
Created almost 6 years ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.rst

..
  This file is generated by setup.py

Write Chimera Map (CMAP) files
==============================

Cmapfile is a Python library and console script to write Chimera Map (CMAP)
files, HDF5 files containing series of 3D XYZ datasets.

CMAP files can be created from numpy arrays and various file formats
containing volume data, for example, BIN, TIFF, LSM, OIF, and OIB.

CMAP files can be visualized using UCSF Chimera [2], a program for interactive
visualization and analysis of molecular structures and related data.

:Author: `Christoph Gohlke `_
:License: BSD 3-Clause
:Version: 2025.1.1

Quickstart
----------

Install the cmapfile package and all dependencies from the
`Python Package Index `_::

    python -m pip install -U cmapfile[all]

Print the command line usage::

    python -m cmapfile --help

See `Examples`_ for usage cases.

Source code and support are available on
`GitHub `_.

Requirements
------------

This revision was tested with the following requirements and dependencies
(other versions may work):

- `CPython `_ 3.10.11, 3.11.9, 3.12.8, 3.13.1 64-bit
- `NumPy `_ 2.1.3
- `Scipy `_ 1.14.1
- `H5py `_ 3.12.1
- `Tifffile `_ 2024.12.12
- `Oiffile `_ 2025.1.1

Revisions
---------

2025.1.1

- Improve type hints.
- Support Python 3.13.

2024.8.28

- Fix lsm2cmap with tifffile > 2024.8.24.
- Drop support for Python 3.9 and numpy < 1.24 (NEP29).

2023.8.30

- Drop support for Python 3.8 and numpy < 1.22 (NEP29).

2022.9.29

- Make subsampling compatible with ChimeraX (breaking).
- Fix deprecated import of scipy.ndimage.interpolation.zoom.
- Switch to Google style docstrings.

2022.2.2

- Add type hints.
- Drop support for Python 3.7 and numpy < 1.19 (NEP29).

2021.2.26

- Fix LSM conversion with tifffile >= 2021.2.26.
- Drop support for Python 3.6 (NEP 29).

2020.1.1

- Do not write name attribute.
- Drop support for Python 2.7 and 3.5.
- Update copyright.

2018.8.30

- Move cmapfile.py into cmapfile package.

2014.10.10

- Initial release.

Notes
-----

The CMAP file format according to [1]::

    Example of HDF format written by Chimera (Chimera map format) follows.
    The Chimera map file reader will allow all fields to be missing (except
    the 3D data).

    /image (group, any name allowed)
     name "centriole" (attribute)
     step (1.2, 1.2, 1.2) (attribute)
     origin (-123.4, -522, 34.5) (attribute)
     cell_angles (90.0, 90.0, 90.0) (attribute)
     rotation_axis (0.0, 0.0, 1.0) (attribute)
     rotation_angle 45.0 (attribute, degrees)
     color (1.0, 1.0, 0, 1.0) (attribute, rgba 0-1 float)
     time 5 (attribute, time series frame number)
     channel 0 (attribute, integer for multichannel data)
     /data (3d array of uint8 (123,542,82)) (dataset, any name allowed)
     /data_x (3d array of uint8 (123,542,82), alternate chunk shape) (dataset)
     /data_2 (3d array of uint8 (61,271,41)) (dataset, any name allowed)
        subsample_spacing (2, 2, 2) (attribute)
     (more subsampled or alternate chunkshape versions of same data)

References
----------

1. Thomas Goddard. [Chimera-users] reading in hdf5 files in chimera.
   https://www.cgl.ucsf.edu/pipermail/chimera-users/2008-September/003052.html
2. UCSF Chimera, an extensible molecular modeling system.
   https://www.cgl.ucsf.edu/chimera/
3. Globals for Images - SimFCS. https://www.lfd.uci.edu/globals/

Examples
--------

Convert a 5D LSM file to CMAP file::

    $ python -m cmapfile "/my data directory/large.lsm"

Convert all BIN files in the current directory to test.cmap. The BIN files
are known to contain 128x128x64 samples of 16-bit integers. The CMAP file
will store float32 maps using subsampling up to 16::

    $ python -m cmapfile --shape 128,128,64 --step 1,1,2 --dtype i2 \
                         --cmap test.cmap --subsample 16 --astype float32 *.bin

Change the step size in the CMAP file::

    $ python -m cmapfile --step 1,1,1.5 test.cmap

Print the cmapfile script usage::

    $ python -m cmapfile --help

    Usage: cmapfile [options] files

    Convert volume data files to Chimera MAP files.

    Options:
    --version             show program's version number and exit
    -h, --help            show this help message and exit
    -q, --quiet
    --filetype=FILETYPE   type of input file(s).
                          For example, BIN, LSM, OIF, TIF
    --dtype=DTYPE         type of data in BIN files. For example, uint16
    --shape=SHAPE         shape of data in BIN files in F order.
                          For example, 256,256,32
    --offset=OFFSET       number of bytes to skip at beginning of BIN files
    --step=STEP           stepsize of data in files in F order.
                          For example, 1.0,1.0,8.0
    --cmap=CMAP           name of output CMAP file
    --astype=ASTYPE       type of data in CMAP file. For example, float32
    --subsample=SUBSAMPLE
                          write subsampled datasets to CMAP file

Owner

  • Name: Christoph Gohlke
  • Login: cgohlke
  • Kind: user
  • Location: Irvine, California

GitHub Events

Total
  • Push event: 1
  • Create event: 1
Last Year
  • Push event: 1
  • Create event: 1

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 49
  • Total Committers: 1
  • Avg Commits per committer: 49.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 8
  • Committers: 1
  • Avg Commits per committer: 8.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Christoph Gohlke c****e@u****u 49
Committer Domains (Top 20 + Academic)
uci.edu: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 83 last-month
  • Total dependent packages: 3
  • Total dependent repositories: 1
  • Total versions: 10
  • Total maintainers: 1
pypi.org: cmapfile

Write Chimera Map (CMAP) files

  • Versions: 10
  • Dependent Packages: 3
  • Dependent Repositories: 1
  • Downloads: 83 Last month
Rankings
Dependent packages count: 10.1%
Dependent repos count: 21.6%
Downloads: 22.6%
Average: 23.2%
Forks count: 29.8%
Stargazers count: 31.9%
Maintainers (1)
Last synced: 6 months ago

Dependencies

setup.py pypi
  • h5py >=3.1
  • numpy >=1.19.2
  • oiffile >=2021.6.6
  • scipy >=1.5
  • tifffile >=2021.11.2