Skip to content

Commit

Permalink
Merge branch 'j_paper' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
lukepolson authored Nov 25, 2024
2 parents c9ed570 + 8f6f440 commit 423b578
Show file tree
Hide file tree
Showing 31 changed files with 4,664 additions and 4,379 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/draft-pdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Draft PDF
on:
push:
paths:
- paper/paper.md
- paper/paper.bib
- with_recon.png
- .github/workflows/draft-pdf.yml

jobs:
paper:
runs-on: ubuntu-latest
name: Paper Draft
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build draft PDF
uses: openjournals/openjournals-draft-action@master
with:
journal: joss
# This should be the path to the paper within your repo.
paper-path: paper/paper.md
- name: Upload
uses: actions/upload-artifact@v4
with:
name: paper
# This is the output path where Pandoc will write the compiled
# PDF. Note, this should be the same directory as the input
# paper.md
path: paper/paper.pdf
18 changes: 9 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
*__pycache__*
paper/jats
paper/paper
paper/*.png
paper/*.pdf
*code-workspace
SlicerSPECTRecon/__pycache__/
SlicerSPECTRecon/Logic/rough.ipynb
.vscode
*__pycache__*
paper/jats
paper/paper
paper/*.png
paper/*.pdf
*code-workspace
SlicerSPECTRecon/__pycache__/
SlicerSPECTRecon/Logic/rough.ipynb
.vscode
90 changes: 45 additions & 45 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
# Contributing to SlicerSPECTRecon

First off, thanks for your interest in contributing! There are many potential options for contributions to this library: most notably, implementation of conversion from alternative sources to dicom format, implementation of different prior functions, implementation of additional reconstruction algorithms, etc. If you wish to contribute:

**Bugs**
1. Open an issue.
2. Provide as much context as you can about what you're running into.
3. Provide project and platform versions.

**New Features**

The recommended method of contributing is as follows:
1. Create an issue on the [issues page](https://github.com/PyTomography/slicer_spect_recon/issues)
2. Fork the repository to your own account
3. Fix issue and push changes to your own fork on GitHub
4. Create a pull request from your fork (whatever branch you worked on) to the development branch in the main repository.

## Setup

To activate and use this module please follow these steps:

1. Either `unzip` the source code or `clone` it from GitHub.
2. Add the respective path in `Slicer` by *Edit -> Application settings -> Modules -> Additional module paths -> Add -> OK*.
3. `Restart` Slicer to apply the changes.
4. `Choose` the module under *Modules -> Tomographic Reconstruction -> SlicerSPECTRecon*.

## Testing

The tests in `Logic/SlicerSPECTReconTest` can be run in `Slicer` itself. Therefore, the module has to be already imported and activated.

Additionally, you have to enable the `developer mode` under *Edit -> Application settings -> Developer -> Enable developer mode -> OK*.

After reloading Slicer, you should see a column `Reload and Test`. To run the tests and changes to the source code, just click this button. This reimports the module with the current changes and runs the code against the given tests.

## Sample Data

The links to the example data (sample patient and simind files) are in the sample_data.txt file in the `Resources` folder.

## Contribute

If you'd like to contribute, you can find an orientation on the Slicer [documentation for developers](https://www.slicer.org/wiki/Documentation/Nightly/Developers).

## License

SlicerSPECTRecon is subject to the `MIT License`, which can be found in the project's root.
# Contributing to SlicerSPECTRecon

First off, thanks for your interest in contributing! There are many potential options for contributions to this library: most notably, implementation of conversion from alternative sources to dicom format, implementation of different prior functions, implementation of additional reconstruction algorithms, etc. If you wish to contribute:

**Bugs**
1. Open an issue.
2. Provide as much context as you can about what you're running into.
3. Provide project and platform versions.

**New Features**

The recommended method of contributing is as follows:
1. Create an issue on the [issues page](https://github.com/PyTomography/slicer_spect_recon/issues)
2. Fork the repository to your own account
3. Fix issue and push changes to your own fork on GitHub
4. Create a pull request from your fork (whatever branch you worked on) to the development branch in the main repository.

## Setup

To activate and use this module please follow these steps:

1. Either `unzip` the source code or `clone` it from GitHub.
2. Add the respective path in `Slicer` by *Edit -> Application settings -> Modules -> Additional module paths -> Add -> OK*.
3. `Restart` Slicer to apply the changes.
4. `Choose` the module under *Modules -> Tomographic Reconstruction -> SlicerSPECTRecon*.

## Testing

The tests in `Logic/SlicerSPECTReconTest` can be run in `Slicer` itself. Therefore, the module has to be already imported and activated.

Additionally, you have to enable the `developer mode` under *Edit -> Application settings -> Developer -> Enable developer mode -> OK*.

After reloading Slicer, you should see a column `Reload and Test`. To run the tests and changes to the source code, just click this button. This reimports the module with the current changes and runs the code against the given tests.

## Sample Data

The links to the example data (sample patient and simind files) are in the sample_data.txt file in the `Resources` folder.

## Contribute

If you'd like to contribute, you can find an orientation on the Slicer [documentation for developers](https://www.slicer.org/wiki/Documentation/Nightly/Developers).

## License

SlicerSPECTRecon is subject to the `MIT License`, which can be found in the project's root.
40 changes: 20 additions & 20 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) [2024] [Obed Dzikunu]

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
MIT License
Copyright (c) [2024] [Obed Dzikunu]
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.
98 changes: 49 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
# SPECT Tomographic Reconstruction 3D Slicer Extension

This is the official repository for the `Slicer` extension `SlicerSPECTRecon`.

This module enables the reconstruction of raw SPECT projection data, providing customizable options for image modeling and image reconstruction. The module has a SIMIND to DICOM converter to permit reconstruction of SIMIND Monte Carlo data.

The module is divided into the following sections:

- Data Converters: Provides tools for converting data from various sources into the DICOM format.
- Input Data: Users can select data from multiple bed positions after loading the projection data into the 3D Slicer DICOM database.
- System Modeling: Allows users to define transforms that are used to build the system matrix.
- Likelihood: Allows users to choose their preferred likelihood function.
- Reconstruction Algorithm: Provides the option of selecting a preferred reconstruction algorithm and their associated parameters

Please refer to the `User_Manual.md` file for further information

## User interface

- Inputs
- Input volume: input SPECT/CT dicom files, simind file (convert to dicom using the data converter)
- Outputs
- Reconstructed volume: The volume will be saved under the specified name (or as the dataset name appended with _reconstructed) and will be located within the Subject Hierarchy in the Data Module.

## Resources

The following link collection should facilitate understanding the code in this extension:

- [Slicer Utils](https://github.com/Slicer/Slicer/blob/master/Base/Python/slicer/util.py)
- [DICOM Introduction](https://www.slicer.org/wiki/Documentation/Nightly/FAQ/DICOM)
- [DICOM Structure](https://www.slicer.org/wiki/Documentation/4.0/Modules/CreateDICOMSeries)
- [DICOM Browser](https://dicom.innolitics.com/ciods)
- [Subject Hierarchy](https://www.slicer.org/wiki/Documentation/4.5/Modules/SubjectHierarchy)

## Sample Data

The links to the example data (sample patient and simind files) are in the sample_data.txt file in the `Resources` folder.

## Contribute

If you'd like to contribute, you can find an orientation on the Slicer [documentation for developers](https://www.slicer.org/wiki/Documentation/Nightly/Developers).

Please read first the `CONTRIBUTING.md` file for further information on how to contribute. You can also check the Pytomography [readthedocs](https://pytomography.readthedocs.io/en/latest/) for an orientation on Pytomography.

## License

SlicerSPECTRecon is subject to the `MIT License`, which is in the project's root.

## Contact

# SPECT Tomographic Reconstruction 3D Slicer Extension

This is the official repository for the `Slicer` extension `SlicerSPECTRecon`.

This module enables the reconstruction of raw SPECT projection data, providing customizable options for image modeling and image reconstruction. The module has a SIMIND to DICOM converter to permit reconstruction of SIMIND Monte Carlo data.

The module is divided into the following sections:

- Data Converters: Provides tools for converting data from various sources into the DICOM format.
- Input Data: Users can select data from multiple bed positions after loading the projection data into the 3D Slicer DICOM database.
- System Modeling: Allows users to define transforms that are used to build the system matrix.
- Likelihood: Allows users to choose their preferred likelihood function.
- Reconstruction Algorithm: Provides the option of selecting a preferred reconstruction algorithm and their associated parameters

Please refer to the `User_Manual.md` file for further information

## User interface

- Inputs
- Input volume: input SPECT/CT dicom files, simind file (convert to dicom using the data converter)
- Outputs
- Reconstructed volume: The volume will be saved under the specified name (or as the dataset name appended with _reconstructed) and will be located within the Subject Hierarchy in the Data Module.

## Resources

The following link collection should facilitate understanding the code in this extension:

- [Slicer Utils](https://github.com/Slicer/Slicer/blob/master/Base/Python/slicer/util.py)
- [DICOM Introduction](https://www.slicer.org/wiki/Documentation/Nightly/FAQ/DICOM)
- [DICOM Structure](https://www.slicer.org/wiki/Documentation/4.0/Modules/CreateDICOMSeries)
- [DICOM Browser](https://dicom.innolitics.com/ciods)
- [Subject Hierarchy](https://www.slicer.org/wiki/Documentation/4.5/Modules/SubjectHierarchy)

## Sample Data

The links to the example data (sample patient and simind files) are in the sample_data.txt file in the `Resources` folder.

## Contribute

If you'd like to contribute, you can find an orientation on the Slicer [documentation for developers](https://www.slicer.org/wiki/Documentation/Nightly/Developers).

Please read first the `CONTRIBUTING.md` file for further information on how to contribute. You can also check the Pytomography [readthedocs](https://pytomography.readthedocs.io/en/latest/) for an orientation on Pytomography.

## License

SlicerSPECTRecon is subject to the `MIT License`, which is in the project's root.

## Contact

Please post any questions to the [Pytomography Discourse Forum](https://pytomography.discourse.group/).
90 changes: 45 additions & 45 deletions SlicerSPECTRecon/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
#-----------------------------------------------------------------------------
set(MODULE_NAME SlicerSPECTRecon)

#-----------------------------------------------------------------------------
set(MODULE_PYTHON_SCRIPTS
${MODULE_NAME}.py
Logic/Algorithms.py
Logic/Callbacks.py
Logic/MetadataUtils.py
Logic/Priors.py
Logic/SimindToDicom.py
Logic/SlicerSPECTReconLogic.py
Logic/VolumeUtils.py
Logic/VtkkmrmlUtils.py
Testing/Python/reconstruction.py
Testing/Python/simind_to_dicom.py
Testing/Python/utils.py
)

set(MODULE_PYTHON_RESOURCES
Resources/Icons/${MODULE_NAME}.png
Resources/UI/${MODULE_NAME}.ui
Resources/algorithmTestSettings.json
Resources/psfMeta.json
Resources/sampleDataMetaData.json
)

#-----------------------------------------------------------------------------
slicerMacroBuildScriptedModule(
NAME ${MODULE_NAME}
SCRIPTS ${MODULE_PYTHON_SCRIPTS}
RESOURCES ${MODULE_PYTHON_RESOURCES}
WITH_GENERIC_TESTS
)

#-----------------------------------------------------------------------------
if(BUILD_TESTING)

# Register the unittest subclass in the main script as a ctest.
# Note that the test will also be available at runtime.
# slicer_add_python_unittest(SCRIPT ${MODULE_NAME}.py)

# Additional build-time testing
add_subdirectory(Logic)
endif()
#-----------------------------------------------------------------------------
set(MODULE_NAME SlicerSPECTRecon)

#-----------------------------------------------------------------------------
set(MODULE_PYTHON_SCRIPTS
${MODULE_NAME}.py
Logic/Algorithms.py
Logic/Callbacks.py
Logic/MetadataUtils.py
Logic/Priors.py
Logic/SimindToDicom.py
Logic/SlicerSPECTReconLogic.py
Logic/VolumeUtils.py
Logic/VtkkmrmlUtils.py
Testing/Python/reconstruction.py
Testing/Python/simind_to_dicom.py
Testing/Python/utils.py
)

set(MODULE_PYTHON_RESOURCES
Resources/Icons/${MODULE_NAME}.png
Resources/UI/${MODULE_NAME}.ui
Resources/algorithmTestSettings.json
Resources/psfMeta.json
Resources/sampleDataMetaData.json
)

#-----------------------------------------------------------------------------
slicerMacroBuildScriptedModule(
NAME ${MODULE_NAME}
SCRIPTS ${MODULE_PYTHON_SCRIPTS}
RESOURCES ${MODULE_PYTHON_RESOURCES}
WITH_GENERIC_TESTS
)

#-----------------------------------------------------------------------------
if(BUILD_TESTING)

# Register the unittest subclass in the main script as a ctest.
# Note that the test will also be available at runtime.
# slicer_add_python_unittest(SCRIPT ${MODULE_NAME}.py)

# Additional build-time testing
add_subdirectory(Logic)
endif()
Loading

0 comments on commit 423b578

Please sign in to comment.