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.0.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.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for labcas_svsedit-0.0.0.tar.gz
Algorithm Hash digest
SHA256 90614518a1d9a377699c5149a26748f6d0f1557cc5028b3799d1b2a382dc30dc
MD5 4b91c0a50d1b478f78672fba205357bf
BLAKE2b-256 cbda9e7af4481ad85c2d0450698973030b204aeb7f4fda10457361025fc232c9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: labcas_svsedit-0.0.0-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.13.7

File hashes

Hashes for labcas_svsedit-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a261209cefca79796d4e61eb34a7e4b25bccafdbe97bbfe49908ca35f802edb5
MD5 b1ed92dc3a5080297b924e91d84cbb16
BLAKE2b-256 8c0c1733cf342fd6685ee369880c03ae83180993b7e62436dde7792e488e9288

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