torch-mando
Differentiable Domain Transform in PyTorch based on mandoct
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.9%) to scientific vocabulary
Repository
Differentiable Domain Transform in PyTorch based on mandoct
Basic Info
Statistics
- Stars: 13
- Watchers: 1
- Forks: 2
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
torch-mando: Differentiable Domain Transform in PyTorch based on MandoCT
This library introduces Differentiable Forward Projection (FPJ) and Filtered Back Projection (FBP) in PyTorch to enable dual-domain deep learning and optimization.
Now support:
- equidistant fan-beam
- geometric calibration
Installation
Check the prerequisites
- torch-mando only works on Linux.
- Prepare CUDA compiler nvcc, PyTorch, and GCC compiler.
Clone the repository
sh
git clone git@github.com:CandleHouse/torch-mando.git --depth 1
cd torch-mando
- Install by running
python setup.py install
About Geometry
Now support the following "parameter.jsonc" files to reduce the influence of geometry on the final results:
- PMatrixFile
- SIDFile
- SDDFile
- ScanAngleFile
- DetectorOffcenterFile
⚠️ It is advised to directly use pMatrix file instead of other files, since pMatrix along is able to describe all possible geometric deformations. You can even use torch-mando to reconstruct fan beam projections or project fan beam images with geometric vibrations, and the result is almost the same with Mandoct.
```python cfg = MandoFanBeamConfig(...)
add params file
cfg.addPmatrixFile(readParamsFile('./params/pmatrixfile.jsonc'), pmatrixDetEltSize=0.4) cfg.addSIDFile(readParamsFile('./params/sidfile.jsonc')) cfg.addSDDFile(readParamsFile('./params/sddfile.jsonc')) cfg.addScanAngleFile(readParamsFile('./params/scanangle.jsonc')) cfg.addDetectorOffCenterFile(readParamsFile('./params/offcenter_file.jsonc')) ```
Example
The main idea is to assemble a Config object which includes all necessary settings to perform FPJ and FBP, and pass it to MandoFanbeamFpj / MandoFanbeamFbp along with the image / sinogram.
```py cfg = MandoFanBeamConfig(imgDim=imgDim, pixelSize=imgPixelSize, sid=750, sdd=1250, detEltCount=detEleCount, detEltSize=detEleSize, views=views, reconKernelEnum=KERNEL_RAMP, reconKernelParam=1, fovCrop=False)
In your network
If you prefer nn.functional F style
def forward(self, x): x = MandoFanbeamFbp(x, cfg)
If you prefer nn.Module layer style
def init(self) -> None: self.fbpLayer = MandoFanbeamFbpLayer(cfg) def forward(self, x): x = self.fbpLayer(x) ```
View example for code details.
Declaration
This work highly depends on previous works by ustcfdm/mangoct, njjixu/mangoct, SEU-CT-Recon/mandoct and matteo-ronchetti/torch-radon. This work draws lots of lessons from them. Thanks for their wonderful work.
Cite this
Please use the following BibTex to cite this work, or click Cite this repository on the right.
@software{torch_mando,
author = {SEU-CT-Recon},
license = {MIT},
title = {torch-mando: Differentiable Domain Transform in PyTorch based on MandoCT},
url = {https://github.com/SEU-CT-Recon/torch-mando}
}
License
MIT
Owner
- Name: SEU-CT-Recon
- Login: SEU-CT-Recon
- Kind: organization
- Repositories: 2
- Profile: https://github.com/SEU-CT-Recon
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: >-
torch-mando: Differentiable Domain Transform in
PyTorch based on MandoCT
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Yuchen
family-names: Lu
email: yclu@seu.edu.cn
affiliation: Southeast University
- given-names: Xu
family-names: Zhuo
email: zhuoxu@seu.edu.cn
affiliation: Southeast University
url: 'https://github.com/CandleHouse/torch-mando'
repository: 'https://github.com/CandleHouse/torch-mando'
license: MIT
GitHub Events
Total
- Watch event: 1
Last Year
- Watch event: 1
Dependencies
- torch *