xrmreader


Namexrmreader JSON
Version 2.9.1 PyPI version JSON
download
home_pagehttps://git5.cs.fau.de/mthies/xrm_reader
SummaryA reader and preprocessor for txrm/xrm data acquired by Zeiss microscopes.
upload_time2023-06-01 08:33:14
maintainer
docs_urlNone
authorMareike Thies
requires_python>=3.6
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Reading and preprocessing x-ray projection data in Zeiss .txrm format

This package extends the [dxchange reader](https://github.com/data-exchange/dxchange "Dxchange github") to read the Zeiss proprietary data format .txrm to python lists or arrays. In particular, the import of metadata from the file headers is extended to access information needed for reconstructing x-ray projection data, e.g. acquired on Zeiss x-ray microscopes. Further, the package contains some simple functions to preprocess x-ray projections in preparation for reconstruction. These include flat field correction, revision of detector shifts, downsampling, conversion into line integral domain and truncation correction.  

For installation, please run
```shell
conda install -c conda-forge dxchange
pip install xrmreader
```

This example code uses [pyconrad](https://git5.cs.fau.de/PyConrad/pyCONRAD "Pyconrad github") for visualization.

```python
import xrmreader
import pyconrad.autoinit
from edu.stanford.rsl.conrad.data.numeric import NumericGrid


projection_data = r'your_file.txrm'

metadata = xrmreader.read_metadata(projection_data)
print(metadata)

# load raw data
raw_projections = xrmreader.read_txrm(projection_data)
NumericGrid.from_numpy(raw_projections).show('Raw projections')

# preprocess data in individual steps
projections = xrmreader.read_txrm(projection_data)
projections = xrmreader.divide_by_reference(projections, metadata['reference'])
projections = xrmreader.revert_shifts(projections, metadata['x-shifts'], metadata['y-shifts'])
projections = xrmreader.downsample(projections, spatial_factor=2)
projections = xrmreader.negative_logarithm(projections)
projections = xrmreader.truncation_correction(projections)
NumericGrid.from_numpy(projections).show('Preprocessed projections version 1')

# load and preprocess data in one step (this does the same thing as the individual steps above, but needs less memory)
preprocessed_projections = xrmreader.read_and_preprocess_txrm(projection_data)
NumericGrid.from_numpy(preprocessed_projections).show('Preprocessed projections version 2')
```

## Copyright


As the reading functionality is modified from the dxchange project by De Carlo et al. 
(https://github.com/data-exchange/dxchange), we reproduce their copyright notice.

Copyright (c) 2016, UChicago Argonne, LLC. All rights reserved.

Copyright 2016. UChicago Argonne, LLC. This software was produced 
under U.S. Government contract DE-AC02-06CH11357 for Argonne National 
Laboratory (ANL), which is operated by UChicago Argonne, LLC for the 
U.S. Department of Energy. The U.S. Government has rights to use, 
reproduce, and distribute this software.  NEITHER THE GOVERNMENT NOR 
UChicago Argonne, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR 
ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE.  If software is 
modified to produce derivative works, such modified software should 
be clearly marked, so as not to confuse it with the version available 
from ANL.

Additionally, redistribution and use in source and binary forms, with 
or without modification, are permitted provided that the following 
conditions are met:

* Redistributions of source code must retain the above copyright 
notice, this list of conditions and the following disclaimer. 

* Redistributions in binary form must reproduce the above copyright 
notice, this list of conditions and the following disclaimer in 
the documentation and/or other materials provided with the 
distribution. 

* Neither the name of UChicago Argonne, LLC, Argonne National 
Laboratory, ANL, the U.S. Government, nor the names of its 
contributors may be used to endorse or promote products derived 
from this software without specific prior written permission. 

THIS SOFTWARE IS PROVIDED BY UChicago Argonne, LLC AND CONTRIBUTORS 
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UChicago 
Argonne, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
POSSIBILITY OF SUCH DAMAGE.


For the rest of the code, this applies.

Copyright (c) 2021 Mareike Thies

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.





            

Raw data

            {
    "_id": null,
    "home_page": "https://git5.cs.fau.de/mthies/xrm_reader",
    "name": "xrmreader",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Mareike Thies",
    "author_email": "mareike.thies@fau.de",
    "download_url": "https://files.pythonhosted.org/packages/90/d0/397ec26615c1352342f5e70f0f0cc00323a1ecfc249b61dfcef63207c0a2/xrmreader-2.9.1.tar.gz",
    "platform": null,
    "description": "## Reading and preprocessing x-ray projection data in Zeiss .txrm format\n\nThis package extends the [dxchange reader](https://github.com/data-exchange/dxchange \"Dxchange github\") to read the Zeiss proprietary data format .txrm to python lists or arrays. In particular, the import of metadata from the file headers is extended to access information needed for reconstructing x-ray projection data, e.g. acquired on Zeiss x-ray microscopes. Further, the package contains some simple functions to preprocess x-ray projections in preparation for reconstruction. These include flat field correction, revision of detector shifts, downsampling, conversion into line integral domain and truncation correction.  \n\nFor installation, please run\n```shell\nconda install -c conda-forge dxchange\npip install xrmreader\n```\n\nThis example code uses [pyconrad](https://git5.cs.fau.de/PyConrad/pyCONRAD \"Pyconrad github\") for visualization.\n\n```python\nimport xrmreader\nimport pyconrad.autoinit\nfrom edu.stanford.rsl.conrad.data.numeric import NumericGrid\n\n\nprojection_data = r'your_file.txrm'\n\nmetadata = xrmreader.read_metadata(projection_data)\nprint(metadata)\n\n# load raw data\nraw_projections = xrmreader.read_txrm(projection_data)\nNumericGrid.from_numpy(raw_projections).show('Raw projections')\n\n# preprocess data in individual steps\nprojections = xrmreader.read_txrm(projection_data)\nprojections = xrmreader.divide_by_reference(projections, metadata['reference'])\nprojections = xrmreader.revert_shifts(projections, metadata['x-shifts'], metadata['y-shifts'])\nprojections = xrmreader.downsample(projections, spatial_factor=2)\nprojections = xrmreader.negative_logarithm(projections)\nprojections = xrmreader.truncation_correction(projections)\nNumericGrid.from_numpy(projections).show('Preprocessed projections version 1')\n\n# load and preprocess data in one step (this does the same thing as the individual steps above, but needs less memory)\npreprocessed_projections = xrmreader.read_and_preprocess_txrm(projection_data)\nNumericGrid.from_numpy(preprocessed_projections).show('Preprocessed projections version 2')\n```\n\n## Copyright\n\n\nAs the reading functionality is modified from the dxchange project by De Carlo et al. \n(https://github.com/data-exchange/dxchange), we reproduce their copyright notice.\n\nCopyright (c) 2016, UChicago Argonne, LLC. All rights reserved.\n\nCopyright 2016. UChicago Argonne, LLC. This software was produced \nunder U.S. Government contract DE-AC02-06CH11357 for Argonne National \nLaboratory (ANL), which is operated by UChicago Argonne, LLC for the \nU.S. Department of Energy. The U.S. Government has rights to use, \nreproduce, and distribute this software.  NEITHER THE GOVERNMENT NOR \nUChicago Argonne, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR \nASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE.  If software is \nmodified to produce derivative works, such modified software should \nbe clearly marked, so as not to confuse it with the version available \nfrom ANL.\n\nAdditionally, redistribution and use in source and binary forms, with \nor without modification, are permitted provided that the following \nconditions are met:\n\n* Redistributions of source code must retain the above copyright \nnotice, this list of conditions and the following disclaimer. \n\n* Redistributions in binary form must reproduce the above copyright \nnotice, this list of conditions and the following disclaimer in \nthe documentation and/or other materials provided with the \ndistribution. \n\n* Neither the name of UChicago Argonne, LLC, Argonne National \nLaboratory, ANL, the U.S. Government, nor the names of its \ncontributors may be used to endorse or promote products derived \nfrom this software without specific prior written permission. \n\nTHIS SOFTWARE IS PROVIDED BY UChicago Argonne, LLC AND CONTRIBUTORS \n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT \nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS \nFOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UChicago \nArgonne, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, \nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, \nBUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; \nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER \nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT \nLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN \nANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \nPOSSIBILITY OF SUCH DAMAGE.\n\n\nFor the rest of the code, this applies.\n\nCopyright (c) 2021 Mareike Thies\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A reader and preprocessor for txrm/xrm data acquired by Zeiss microscopes.",
    "version": "2.9.1",
    "project_urls": {
        "Homepage": "https://git5.cs.fau.de/mthies/xrm_reader"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ccb08be3c08f976acf2828c0a646be4a2cceb3713e204bf19be6e42956d8432b",
                "md5": "ee81e080e5b09e03b2b242a41358e616",
                "sha256": "f34ad3648fa24402c932e480a859dce0bb54d5f0acea491acf71406c7d1ecff1"
            },
            "downloads": -1,
            "filename": "xrmreader-2.9.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ee81e080e5b09e03b2b242a41358e616",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 15217,
            "upload_time": "2023-06-01T08:33:12",
            "upload_time_iso_8601": "2023-06-01T08:33:12.584176Z",
            "url": "https://files.pythonhosted.org/packages/cc/b0/8be3c08f976acf2828c0a646be4a2cceb3713e204bf19be6e42956d8432b/xrmreader-2.9.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "90d0397ec26615c1352342f5e70f0f0cc00323a1ecfc249b61dfcef63207c0a2",
                "md5": "b2f8b669624c939528fd9a42b4297302",
                "sha256": "cdc0106a17b838c34ded180368c9998496df513076f67bed2e87add90ed14ebf"
            },
            "downloads": -1,
            "filename": "xrmreader-2.9.1.tar.gz",
            "has_sig": false,
            "md5_digest": "b2f8b669624c939528fd9a42b4297302",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 15558,
            "upload_time": "2023-06-01T08:33:14",
            "upload_time_iso_8601": "2023-06-01T08:33:14.962824Z",
            "url": "https://files.pythonhosted.org/packages/90/d0/397ec26615c1352342f5e70f0f0cc00323a1ecfc249b61dfcef63207c0a2/xrmreader-2.9.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-01 08:33:14",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "xrmreader"
}
        
Elapsed time: 0.07563s