Skip to content

Commit

Permalink
renaming package for pypi conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
mcencini committed Dec 5, 2024
1 parent acd8826 commit 42a7eae
Show file tree
Hide file tree
Showing 72 changed files with 178 additions and 486 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ tmp/
docs/generated/
docs_build/

src/mrsim/_version.py
src/torchsim/_version.py
61 changes: 38 additions & 23 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
MRSim
=====
TorchSim
========

MRSim is a pure Pytorch-based MR simulator, including analytical and EPG model.
TorchSim is a pure Pytorch-based MR simulator, including analytical and EPG model.

|Coverage| |CI| |CD| |License| |Codefactor| |Sphinx| |PyPi| |Black| |PythonVersion|

.. |Coverage| image:: https://infn-mri.github.io/mrsim/_static/coverage_badge.svg
:target: https://infn-mri.github.io/mrsim
.. |Coverage| image:: https://infn-mri.github.io/torchsim/_static/coverage_badge.svg
:target: https://infn-mri.github.io/torchsim

.. |CI| image:: https://github.com/INFN-MRI/mrsim/workflows/CI/badge.svg
:target: https://github.com/INFN-MRI/mrsim
.. |CI| image:: https://github.com/INFN-MRI/torchsim/workflows/CI/badge.svg
:target: https://github.com/INFN-MRI/torchsim

.. |CD| image:: https://github.com/INFN-MRI/mrsim/workflows/CD/badge.svg
:target: https://github.com/INFN-MRI/mrsim
.. |CD| image:: https://github.com/INFN-MRI/torchsim/workflows/CD/badge.svg
:target: https://github.com/INFN-MRI/torchsim

.. |License| image:: https://img.shields.io/github/license/INFN-MRI/mrsim
:target: https://github.com/INFN-MRI/mrsim/blob/main/LICENSE.txt
.. |License| image:: https://img.shields.io/github/license/INFN-MRI/torchsim
:target: https://github.com/INFN-MRI/torchsim/blob/main/LICENSE.txt

.. |Codefactor| image:: https://www.codefactor.io/repository/github/INFN-MRI/mrsim/badge
:target: https://www.codefactor.io/repository/github/INFN-MRI/mrsim
.. |Codefactor| image:: https://www.codefactor.io/repository/github/INFN-MRI/torchsim/badge
:target: https://www.codefactor.io/repository/github/INFN-MRI/torchsim

.. |Sphinx| image:: https://img.shields.io/badge/docs-Sphinx-blue
:target: https://infn-mri.github.io/mrsim
:target: https://infn-mri.github.io/torchsim

.. |PyPi| image:: https://img.shields.io/pypi/v/mrsim
:target: https://pypi.org/project/mrsim
.. |PyPi| image:: https://img.shields.io/pypi/v/torchsim
:target: https://pypi.org/project/torchsim

.. |Black| image:: https://img.shields.io/badge/style-black-black

Expand All @@ -33,7 +33,7 @@ MRSim is a pure Pytorch-based MR simulator, including analytical and EPG model.

Features
--------
MRSim contains tools to implement parallelized and differentiable MR simulators. Specifically, we provide
TorchSim contains tools to implement parallelized and differentiable MR simulators. Specifically, we provide

1. Automatic vectorization of across multiple atoms (e.g., voxels).
2. Automatic generation of forward and jacobian methods (based on forward-mode autodiff) to be used in parameter fitting or model-based reconstructions.
Expand All @@ -44,24 +44,39 @@ MRSim contains tools to implement parallelized and differentiable MR simulators.
Installation
------------

MRSim can be installed via pip as:
TorchSim can be installed via pip as:

.. code-block:: bash
pip install mrsim
pip install torchsim
Basic Usage
-----------
Using TorchSim, we can quickly implement and run MR simulations.
We also provide pre-defined simulators for several applications:

.. code-block:: python
import numpy as np
import torchsim
# generate a flip angle pattern
flip = np.concatenate((np.linspace(5, 60.0, 300), np.linspace(60.0, 2.0, 300), np.ones(280)*2.0))
sig, jac = torchsim.mrf_sim(flip=flip, TR=10.0, T1=1000.0, T2=100.0, diff=("T1","T2"))
This way we obtained the forward pass signal (``sig``) as well as the jacobian
calculated with respect to ``T1`` and ``T2``.


Development
~~~~~~~~~~~
-----------

If you are interested in improving this project, install MRSim in editable mode:
If you are interested in improving this project, install TorchSim in editable mode:

.. code-block:: bash
git clone [email protected]:INFN-MRI/mrsim
cd mrsim
git clone [email protected]:INFN-MRI/torchsim
cd torchsim
pip install -e .[dev,test,doc]
Expand Down
96 changes: 48 additions & 48 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Base classes and routines for MR simulator implementation.
:toctree: generated
:nosignatures:

mrsim.base.AbstractModel
mrsim.base.autocast
torchsim.base.AbstractModel
torchsim.base.autocast

Parameter configuration
~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -19,11 +19,11 @@ Parameter configuration
:toctree: generated
:nosignatures:

mrsim.base.prepare_environmental_parameters
mrsim.base.prepare_single_pool
mrsim.base.prepare_two_pool_bm
mrsim.base.prepare_two_pool_mt
mrsim.base.prepare_three_pool
torchsim.base.prepare_environmental_parameters
torchsim.base.prepare_single_pool
torchsim.base.prepare_two_pool_bm
torchsim.base.prepare_two_pool_mt
torchsim.base.prepare_three_pool

Extended Phase Graphs
---------------------
Expand All @@ -33,9 +33,9 @@ Subroutines for Extended Phase Graphs based simulators.
:toctree: generated
:nosignatures:

mrsim.epg.states_matrix
mrsim.epg.get_signal
mrsim.epg.get_demodulated_signal
torchsim.epg.states_matrix
torchsim.epg.get_signal
torchsim.epg.get_demodulated_signal

RF Pulses
~~~~~~~~~
Expand All @@ -44,16 +44,16 @@ RF Pulses
:toctree: generated
:nosignatures:

mrsim.epg.rf_pulse_op
mrsim.epg.phased_rf_pulse_op
mrsim.epg.multidrive_rf_pulse_op
mrsim.epg.phased_multidrive_rf_pulse_op
mrsim.epg.rf_pulse
torchsim.epg.rf_pulse_op
torchsim.epg.phased_rf_pulse_op
torchsim.epg.multidrive_rf_pulse_op
torchsim.epg.phased_multidrive_rf_pulse_op
torchsim.epg.rf_pulse

mrsim.epg.initialize_mt_sat
mrsim.epg.mt_sat_op
mrsim.epg.multidrive_mt_sat_op
mrsim.epg.mt_sat
torchsim.epg.initialize_mt_sat
torchsim.epg.mt_sat_op
torchsim.epg.multidrive_mt_sat_op
torchsim.epg.mt_sat

Relaxation and Exchange
~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -62,14 +62,14 @@ Relaxation and Exchange
:toctree: generated
:nosignatures:

mrsim.epg.longitudinal_relaxation_op
mrsim.epg.longitudinal_relaxation
mrsim.epg.longitudinal_relaxation_exchange_op
mrsim.epg.longitudinal_relaxation_exchange
mrsim.epg.transverse_relaxation_op
mrsim.epg.transverse_relaxation
mrsim.epg.transverse_relaxation_exchange_op
mrsim.epg.transverse_relaxation_exchange
torchsim.epg.longitudinal_relaxation_op
torchsim.epg.longitudinal_relaxation
torchsim.epg.longitudinal_relaxation_exchange_op
torchsim.epg.longitudinal_relaxation_exchange
torchsim.epg.transverse_relaxation_op
torchsim.epg.transverse_relaxation
torchsim.epg.transverse_relaxation_exchange_op
torchsim.epg.transverse_relaxation_exchange

Gradient Dephasing
~~~~~~~~~~~~~~~~~~
Expand All @@ -78,8 +78,8 @@ Gradient Dephasing
:toctree: generated
:nosignatures:

mrsim.epg.shift
mrsim.epg.spoil
torchsim.epg.shift
torchsim.epg.spoil

Magnetization Prep
~~~~~~~~~~~~~~~~~~
Expand All @@ -88,7 +88,7 @@ Magnetization Prep
:toctree: generated
:nosignatures:

mrsim.epg.adiabatic_inversion
torchsim.epg.adiabatic_inversion

Flow and Diffusion
~~~~~~~~~~~~~~~~~~
Expand All @@ -97,10 +97,10 @@ Flow and Diffusion
:toctree: generated
:nosignatures:

mrsim.epg.diffusion_op
mrsim.epg.diffusion
mrsim.epg.flow_op
mrsim.epg.flow
torchsim.epg.diffusion_op
torchsim.epg.diffusion
torchsim.epg.flow_op
torchsim.epg.flow

Signal Models
-------------
Expand All @@ -113,8 +113,8 @@ Analytical
:toctree: generated
:nosignatures:

mrsim.models.bSSFPModel
mrsim.models.SPGRModel
torchsim.models.bSSFPModel
torchsim.models.SPGRModel

Iterative
~~~~~~~~~
Expand All @@ -123,10 +123,10 @@ Iterative
:toctree: generated
:nosignatures:

mrsim.models.FSEModel
mrsim.models.MP2RAGEModel
mrsim.models.MPnRAGEModel
mrsim.models.MRFModel
torchsim.models.FSEModel
torchsim.models.MP2RAGEModel
torchsim.models.MPnRAGEModel
torchsim.models.MRFModel

Functional
----------
Expand All @@ -139,8 +139,8 @@ Analytical
:toctree: generated
:nosignatures:

mrsim.bssfp_sim
mrsim.spgr_sim
torchsim.bssfp_sim
torchsim.spgr_sim

Iterative
~~~~~~~~~
Expand All @@ -149,10 +149,10 @@ Iterative
:toctree: generated
:nosignatures:

mrsim.fse_sim
mrsim.mp2rage_sim
mrsim.mpnrage_sim
mrsim.mrf_sim
torchsim.fse_sim
torchsim.mp2rage_sim
torchsim.mpnrage_sim
torchsim.mrf_sim

Miscellaneous
-------------
Expand All @@ -162,7 +162,7 @@ Other simulation utilities.
:toctree: generated
:nosignatures:

mrsim.utils.b1rms
mrsim.utils.slice_prof
torchsim.utils.b1rms
torchsim.utils.slice_prof


16 changes: 8 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

# -- Project information -----------------------------------------------------

project = "mrsim"
copyright = "2024, MRSim Contributors"
author = "MRSim Contributors"
project = "torchsim"
copyright = "2024, TorchSim Contributors"
author = "TorchSim Contributors"

# -- General configuration ---------------------------------------------------

Expand Down Expand Up @@ -73,9 +73,9 @@
# -- Options for Sphinx Gallery ----------------------------------------------

sphinx_gallery_conf = {
"doc_module": "mrsim",
"doc_module": "torchsim",
"backreferences_dir": "generated/gallery_backreferences",
"reference_url": {"mrsim": None},
"reference_url": {"torchsim": None},
"examples_dirs": ["../examples/"],
"gallery_dirs": ["generated/autoexamples"],
"filename_pattern": "/0",
Expand All @@ -84,7 +84,7 @@
"within_subsection_order": "FileNameSortKey",
"binder": {
"org": "infn-mri",
"repo": "mrsim",
"repo": "torchsim",
"branch": "gh-pages",
"binderhub_url": "https://mybinder.org",
"dependencies": [
Expand Down Expand Up @@ -115,7 +115,7 @@
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ["_static"]
html_theme_options = {
"repository_url": "https://github.com/INFN-MRI/mrsim",
"repository_url": "https://github.com/INFN-MRI/torchsim",
"use_repository_button": True,
"use_issues_button": True,
"use_edit_page_button": True,
Expand All @@ -125,4 +125,4 @@

# html_logo = "_static/logos/mri-nufft.png"
# html_favicon = "_static/logos/mri-nufft-icon.png"
html_title = "MRSim Documentation"
html_title = "TorchSim Documentation"
20 changes: 10 additions & 10 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
Getting Started
===============

Installing MRSim
-----------------
Installing TorchSim
-------------------

MRSim is available on PyPi
TorchSim is available on PyPi

.. code-block:: sh
pip install mrsim
pip install torchsim
Development Version
~~~~~~~~~~~~~~~~~~~

If you want to modifiy the mrsim code base
If you want to modifiy the ``torchsim`` code base

.. code-block:: sh
git clone https://github.com/INFN-MRI/mrsim
pip install -e ./mrsim[test, dev, doc]
git clone https://github.com/INFN-MRI/torchsim
pip install -e ./torchsim[test, dev, doc]
Basic Usage
===========
Using MRSim, we can quickly implement and run MR simulations.
Using TorchSim, we can quickly implement and run MR simulations.
We also provide pre-defined simulators for several applications:

.. code-block:: python
import numpy as np
import mrsim
import torchsim
# generate a flip angle pattern
flip = np.concatenate((np.linspace(5, 60.0, 300), np.linspace(60.0, 2.0, 300), np.ones(280)*2.0))
sig, jac = mrsim.mrf_sim(flip=flip, TR=10.0, T1=1000.0, T2=100.0, diff=("T1","T2"))
sig, jac = torchsim.mrf_sim(flip=flip, TR=10.0, T1=1000.0, T2=100.0, diff=("T1","T2"))
This way we obtained the forward pass signal (``sig``) as well as the jacobian
calculated with respect to ``T1`` and ``T2``.
Expand Down
Loading

0 comments on commit 42a7eae

Please sign in to comment.