Skip to main content

PHI/PII removal tool for SVS files

Project description

🔬 SVS edit

Editing SVS files (headers) using python module tifftools.

📀 Installation

Create a Python virtual environment (to isolate dependencies from other Python packages you may be using), activate it, and then install it. Typically:

$ python3.13 -m venv svs
$ cd svs
$ source bin/activate  # Or source bin/activate.csh for csh/tcsh users
(venv) $ pip install labcas-svsedit

This makes the svs-edit command-line tool available; run:

svs-edit --help

To see the options. For example, to replace the Filename field with the text deid in input.svs and write to output.svs, run:

svs-edit --edit-desc Filename=deid input.svs output.svs

You can run on batches of files by wrapping the svs-edit invocation in a loop. For example, to replace the Filename field with the basename (without extension) of the SVS's file's name:

$ for f in *.svs; do
> svs-edit --edit-desc Filename=$(basename $f .svs) $f subdir/$f
> done

Or in csh/tcsh:

% foreach f (*.svs)
foreach? svs-edit. --edit-desc Filename=$f:r $f subdir/$f
foreach? end

By default the above replaces only those components which have the corresponding tag.

Changes can be tested by dumping the header of the newly written file using: tifftools dump subdir/svsfile.svs

🛠️ Development

To develop and debug this software, clone this repository and install the source code into a Python virtual environment in editable mode:

$ git clone https://github.com/jpl-labcas/svs_edit.git
$ cs svs_edit
$ python3.13 -m venv .venv
$ source .venv/bin/activate  # Or source .venv/bin/activate.csh for csh/tcsh users
(venv) $ pip install --editable .

The svs-edit command now uses the source code under src/jpl/labacs/svs and changes made to Python files take effect when the command is next run.

🥧 Making Releases

To release the software to the Python Package Index use build and twine:

$ pip install build twine
$ .venv/bin/python3 -m build .
$ twine upload dist/*

👥 Contributing

Within the JPL Informatics Center, we value the health of our community as much as the code, and that includes participation in creating and refining this software. Towards that end, we ask that you read and practice what's described in these documents:

  • Our contributor's guide delineates the kinds of contributions we accept.
  • Our code of conduct outlines the standards of behavior we practice and expect by everyone who participates with our software.

🔢 Versioning

We use the SemVer philosophy for versioning this software.

📃 License

The project is licensed under the Apache version 2 license.

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

labcas_svsedit-0.0.1.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

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

labcas_svsedit-0.0.1-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file labcas_svsedit-0.0.1.tar.gz.

File metadata

  • Download URL: labcas_svsedit-0.0.1.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for labcas_svsedit-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f4fb369827796c0d67ea4f29ff32fb41af8bc94e447e4e607f965e0ec5c1b87a
MD5 071fb2305174bf315c277c83d5c7c45c
BLAKE2b-256 960a88afa0f55a513708d5fb129cc61b45089e51fdfaa94bd7b2bcc4187de9fa

See more details on using hashes here.

File details

Details for the file labcas_svsedit-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: labcas_svsedit-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for labcas_svsedit-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 575a609415981fc334676c0eacf8c31a7dc4c491d6e51cce3b229883ab2e0975
MD5 1141d9a77fe5c9f7463c23e370df721f
BLAKE2b-256 369cfa9658bf31b495181c1acfb6d11a22dde3b5f668329acda5e50be7b7eee4

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