Git Product home page Git Product logo

inhomcorr's Introduction

InhomCorr

Python License codecov Documentation

Installation for developers

  1. Clone the repo
  2. Create/select a python environment
  3. Open terminal in the "InhomCorr" main folder
  4. Install "InhomCorr" in editable mode with linting and testing: pip install -e ".[lint,test]"
  5. Setup Pre-Commit Hook: pre-commit install

Recommended IDE and Extensions

We recommend to use Microsoft Visual Studio Code with the following extensions:

  • Python (Microsoft)
  • Pylance (Microsoft)
  • isort (Microsoft)
  • Python Indent (Kevin Rose)
  • Python Type Hint (njqdev)
  • Editorconfig for VS Code (EditorConfig)
  • Mypy (Martan Gover)
  • autoDocstring (Nils Werner)
  • markdownlint (David Anson)
  • Even Better TOML (tamasfe)

Further extensions that might be useful:

  • IntelliCode (Microsoft)
  • Remote - SHH (Microsoft)
  • GitHub Copilot (GitHub - fee-based )

Note that this project uses a pyproject.toml instead of setup.py file

inhomcorr's People

Contributors

cgatefait avatar chaigner avatar ckolbptb avatar fzimmermann89 avatar schote avatar schuenke avatar sschmitter avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

inhomcorr's Issues

Missing Docstrings

We have default docstrings in some places,
for example

should contain a description and the units etc in the docstrings, instead of
_description_

Somebody should go through main and see where we messed up so far and fix it, and we should maybe remember to check in in code review (Mea culpa, I missed it).

On the other work-in-progress branches we might have also those, I will try to remember to complain about those during the review of the PRs..

Design Discussion: Avoid None's

Hey everbody,

close to the end, CK and I had the discussion about some of the None's

I believe we came to the following conclusions:

  • We should avoid returning Nones (and typing everything like it can return Nones)
  • QMRIData should not return None's if asked for some map.
    • either it returns a default map or it throws an exception if the values has not been
      set and a default map is not possible.
  • An ImageData without data should maybe not exist, i.e. force setting the image in the constructor. This way, the numpy conversion never has to return None as well.

Otherwise we have to check for None everywhere and write lots tests that handle these corner cases in each downstream function...

What do you think?

CPU/GPU tensors

If I undestand it correctly than currently we don't specify anywhere if we want a tensor on the CPU or GPU.

Would it make sense that the MRData class has a function .cuda() and .cpu()? This would then e.g. move _data and _mask to GPU/CPU for ImageData and _t1 _rho and _mask for QMRIData.

How do you normally specify the device? Is this a global variable you set and then everything is put to the same device or do you specify this for each tensor?

Move BaseClasses and Interfaces into submodules

We discussed and decided to move the base classes/interfaces/... from the "interface" subfolder to the individual submodules and adjust the naming accroding to what they actually are.

MRData
QMRData
ImageData

should be moved to the inhomcorr folder (not into a specific submodule)

Design discussion: avoid manual 'get' and 'set' functions

Like Python has built-in support for properties, it also has built-in functionality for indexable objects via getitem .
An example would be the get_data function in for the dataloaders. We could try to design it in a way that the QMRIDataLoader is indexable (Pseudo-Code):

class QMRIDataLoader:
     def __getitem__(self, id):
          return self.item[0]

Then, later one, we could use it as

obj=QMRIDataLoader(...)
obj[0]

This would make it more 'pythonic' and consistent, for example, with how pytorch datasets are supposed to work.

unknown units

So far we have not specified the unites of e.g. t1 anywhere. We could

  1. add this in the comments of QMRIData
  2. change "t1" to "t1_in_s"

I would prefer option 2. What do you think?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.