Git Product home page Git Product logo

biomedical-imaging-group / globalbioim Goto Github PK

View Code? Open in Web Editor NEW
76.0 11.0 35.0 28.62 MB

A unifying Matlab framework for the development of reconstruction algorithms (solving inverse problems) in computational imaging

Home Page: https://biomedical-imaging-group.github.io/GlobalBioIm/

License: GNU General Public License v3.0

MATLAB 91.58% C 4.34% C++ 4.08%
image-processing linear-algebra matlab-library inverse-problems image-reconstruction

globalbioim's People

Contributors

aleixbp avatar esoubies avatar ferreols avatar laurenedonati avatar octavemartin avatar poldap avatar thanhanpham avatar thomasdeb avatar tokkot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

globalbioim's Issues

Generic Broadcasting, Concatenation...

There is still two classes (OneToMany and StackLinOp) that should be properly integrated in the new framework (v1.0 milestone). We should think to which extend it is possible to have generic broadcasting and concatenation tools for LinOps.

Broken Adjoint Calculation in StackMap

Hello GBI Team,

thanks for creating and maintaining this neat Matlab library!

I was facing some issues regarding the adjoint calculation in applyJacobianT_ of StackMap:

function x = applyJacobianT_(this, y, v)
    % Reimplemented from :class:`Map`   
    x = cell(this.numMaps,1);
    for n = 1:this.numMaps
        x{n} = this.alpha(n) .* this.mapsCell{n}.applyJacobianT(y,v);
    end
    x = cat(length(this.sizeout),x{:});
end
  • Size related run-time failure.
  • Functional issue: the forward pass at its core is broadcast -> per-channel-op-application -> concat; so the backward pass should be slice -> per-channel-op-transpose-application -> sum-reduction.
function x = applyJacobianT_(this, y, v)
    % Reimplemented from :class:`Map`
    
    % The adjoint op of a StackMap (:= apply & concat) is slice &
    % apply & summation.
    % Therefore we need to slice the upstream gradient along its
    % last dimension. To be working with arbitrary dimension, we
    % could e.g. use approaches like:
    %     https://stackoverflow.com/questions/19955653/matlab-last-dimension-access-on-ndimensions-matrix
    % For now, we take the simple path just flatten it to 2-D,
    % followed by another reshape op back to basic.

    % TODO(cl): quick'n'dirty, to be tested for robustness!
    
    full_dim = size(y);
    plain_dim = full_dim(1:end - 1);
    cat_dim = full_dim(end);
    
    y_flattened = reshape(y, [], cat_dim);
    
    x = cell(this.numMaps,1);

    for n = 1:this.numMaps
        y_n = reshape(y_flattened(:, n), plain_dim);
        x{n} = this.alpha(n) .* this.mapsCell{n}.applyJacobianT(y_n,v);
    end

    x = cat(length(this.sizeout),x{:});
    x = sum(x, length(this.sizeout));
end

What's your thoughts on a preferred solution? Let me know! Of course, this needs testing and cleaning-up...

Somewhat related question. Calculating the adjoint of StackMap * UpstreamOp, the adjoint of UpsteamOp gets executed multiple times, once for each channel of StackMap. Any better solution than wrapping StackMap functionality to first execute and sum all channel contributions before passing the gradient to the upstream node?

Best,
CL

Generic norm computation

Should we include a default call to the function estimateNorm as soon as an access to the norm field of a LinOp is performed ? Or this should be let to the user ?

Error running examples

Hi,

I got an error when I run one of the examples of Deconv_Ls_NonNeg_NoReg.m, when Installing OptimPackLegacy, the below error came out:

Building with 'Microsoft Visual C++ 2017 (C)'.
Error using mex
opl_vmlmb.c
P:\work\research\toolbox\GlobalBioIm\Opti\OptiUtils\MatlabOptimPack\OptimPackLegacy-master\src\opl_vmlmb.c(100):
error C2059: syntax error: ''
P:\work\research\toolbox\GlobalBioIm\Opti\OptiUtils\MatlabOptimPack\OptimPackLegacy-master\src\opl_vmlmb.c(104):
error C2059: syntax error: ''

Error in installOptimPack (line 37)
eval(['mex ',matDir,'m_opl_vmlmb_get_reason.c ', CFiles,MexOpt]);
Error in OptiVMLMB (line 97)
installOptimPack();
Error in Deconv_LS_NonNeg_NoReg (line 68)
VMLMB=OptiVMLMB(F,0.,[]);

I'm using Win10 and Matlab 2019 a with 'Microsoft Visual C++ 2017 (C)'. Hope this can be resolved soon.

Thanks.

Bug in summing "LinOpConv"s with different indices

I encountered a bug when trying to sum two "LinOpConv" operators whose dimensions along which the convolution is performed do not match. I'm attaching a code snippet illustrating the problem. I don't think it is possible to rewrite this sum as a single convolution operator in the general case, so an easy fix would be to change the "plus_" method of LinOpConv accordingly (from testing isa(G,'LinOpConv') to something like isa(G,'LinOpConv') && isequal(sort(this.index), sort(G.index))). However I'm not sure I fully understand all the subcases of the "plus_" method so I'm not confortable trying to fix the problem completely myself
GlobalBioIm_bug
f.

Improvements to composition mechanisms

Some examples of stuff that have to be improved:

  • In Map plus_ and minus_ test if equal to itself (or a scaled version of itself) and return the corresponding scaled version of itself. Do the analogy in LinOp and Cost.
  • In Map makeComposition_ test if inverse and return identity (the analogy of makeComposition_ in MapInversion)
  • For LinOpConv if we do H^-1*H we get a LinOpConv and not an identity. In makeComposition_ of LinOpConv test if the new mtf is constant and return the appropriate LinOpDiag. This is more general and holds other LinOps that have a new implementation of mpower_
  • add the possibility to add a scalar to a Map for adding a scaled identity

Acknowledging EPFL and CIBM

After discussing with Michael it seems it would be convenient to acknowledge CIBM by adding a logo somewhere. I think the most natural would be to also add an EPFL one. If you agree I will go ahead and make a PR with respect to that. Thanks ;-)

Make sphinx documentation work for python 3

Python 2.7 will soon no longer be supported on travis.
Our doc is stuck with python 2.7 and sphinx 1.8. and sphinxcontrib-matlabdomain 0.7 (see requirements.txt )
Pull request #5 #6 #7 are only temporary fix

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.