Giter Club home page Giter Club logo

mermaid's People

Contributors

fxv27 avatar hastingsgreer avatar hbgtjxzbbx avatar marcniethammer avatar rkwitt avatar stephaniehaeger avatar tina-lintian avatar wildphoton avatar xhs400 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mermaid's Issues

wrong inverse map

The inverse map output is wrong when the initial map is not the identity map. It can be corrected by manually set the initial inverse map.

Must I0 and I1 be resampled to the same spacing before registration?

Must the moving image and the reference image have the same spaing?

si.register_images(I0, I1, spacing, model_name='lddmm_shooting_map',
nr_of_iterations=100,
use_multi_scale=False,
visualize_step=5,
optimizer_name='sgd',
learning_rate=0.1,
rel_ftol=1e-7,
json_config_out_filename=('test2d_tst.json',
'test2d_tst_with_comments.json'),
params='test2d_tst.json',
recording_step=None)
I0 and I1 must have the same spacing?Must I0 and I0 be resampled to the same spacing before registration?

interpolations

It would be good to have an option of doing interpolation that is better than linear interpolation. For example, b-splines would be good. This would be useful in particularly also for the low-res parameterizations.

CUDA FFT and odd last dimension

The dimensions are not correct after ifft, because of the real fft in CUDA (for the Fourier filtering).
Fixed currently with a quick hack for map_low_res_factor which makes sure the last dimension is even. Needs a more proper solution.

update demos/testRegistration.py

Line 16 that is loading the json file does not match the file's name and directory. Could you please update it to:
params.load_JSON('../test/json/svf_momentum_base_config.json')

flipped spacing in ImageIO

In ImageIO.read() the spacing was flipped to match the order of numpy array dimensions. However, it was not flipped back when writing into an image file using ImageIO.write().

LNCC similarity result is out of range of [0,1] when images have large portion of zero valued area

LNCC output will be out of the range [0,1] when the images have large area with zero value.

Steps to reproduce:

  1. Generate Data:
params = pars.ParameterDict()
params['square_example_images']['len_s'] = 10
params['square_example_images']['len_l'] = 30
I0,I1,spacing = EG.CreateSquares(dim=3, add_noise_to_bg=False).create_image_pair(np.array([64, 64, 64]),params=params)
  1. Register with LNCC similarity.
params['model']['registration_model']['type'] = "svf_vector_momentum_map" 
params['model']['registration_model']['similarity_measure']['type'] = "lncc"
opt = MO.SimpleSingleScaleRegistration(I0,
                                       I1,
                                       spacing,
                                       sz,
                                       params,
                                       compute_inverse_map=False)
opt.register()

The log shows as follows:
0-Tot: E=099.4140 | simE=099.4140 | regE=000.0000 | optParE=000.0000 | relF= n/a |
0-Img: E=099.4140 | simE=099.4140 | regE=000.0000 |

force registration running on CPU

Hi,

How can I force the register_image on CPU? By default, example_simple_interface.py seems always run on GPU, even if CUDA_ON was set to false.

Thank you

Clear model function for atlas builder

The atlas builder runs svf registration in a for loop and uses model properties from the previous registration for the current registration. A function that clears the model beforehand is needed.

energies should not be invariant to batch-size

Currently, the energies are divided by the batch-size, so that the energies stay the same independent of the size of the batch. But this is not a good idea, because then one requires a different learning rate for different batch sizes.

Needs to be fixed (i.e., remove division by batch-size for all the energy terms), but maybe add a display option that also displays energy normalized by batch if desired.

Add Zenodo badge for citation

Zenodo enables creation of an open source scientific software citation, complete with a DOI. This enable recognition of the work and reproducibility through identification of computational dependencies.

An GitHub README badge with the citation that is automatically updated when a GitHub Release is created can be generated as documented here:

https://guides.github.com/activities/citable-code/

mermaid 0.3.2 has a non-standard dependency specifier torch>=1.7torchvision

I've been getting this message from pip:

DEPRECATION: mermaid 0.3.2 has a non-standard dependency specifier torch>=1.7torchvision. pip 23.3 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of mermaid or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at pypa/pip#12063

bad result

I used this code to train my own data set. My data set came from ADNI. I used 240 pieces as the training set, 70 pieces as the verification set, and 34 pieces as the test set.I did not change other parameters, but the result of training test is worse than Voxelmorph. Could you please give me some opinion analysis.

Maps, spacing, and regularization.

Maps are currently all in [-1,1]^d and ignore the spacing. This is problematic because the Gaussian kernels for regularization rely on this spacing.

Instead the maps should be in the range of the spatial extent of an image (for a given spacing).

Requires a change of the core interpolation functions to do this mapping (as these rely on the canonical [-1,1] mapping).

Modify the image size

After I modified the value of example_img_len in the script example_minimal_registration_without_simple_interface.py, the result seems to be wrong, the mesh does not change after iteration, and converges to the tolerance in step 29. When the image data size becomes 640*360, do I need to modify other parameters?

image

image

reference paper

Hi,
Thank you for sharing such brilliant codes.

Could you provide more detailed documents for implementation, such as reference papers?
I am a beginner to LDDMM. I have read several papers about LDDMM. But I can not figure out what method you used in the codes.

Thank you very much.

Issue with spacing for upsampling and downsampling

The upsampling and downsampling is unnatural. As it uses (current_size-1)/(desired_size-1). This is strange. If one has a 4x4 image with spacing 1/3 it will become a spacing of 1 one upsampled to 2x2 instead of 2/3. To properly support this an origin should be introduced.

Consensus Algorithm

Hello,

I was wondering if there was something to describe what the consensus model is actually doing?
Is there a paper that could be used as a reference as well?

@marcniethammer any advice (as the contributor) would be appreciated!

Thank you!

where is the test2d_tst.json?

when i run the jupyter --example_simple_interface.
the test2d_tst.json can't find in the repository.
and there's an error
Could not open file = test2d_tst.json; ignoring request.

pytorch >0.3.0

Code needs to be adapted to work with the newer pytorch. Currently only runs with pytorch 0.3.x

Custom multiscale example no longer works

For some reason this code crashes
testRegistrationGenericMultiscaleCustom.py

MySVFNet (
)
Registering new similarity measure mySSD in factory
Optimizing for at most 20 iterations
Warning: optimizer name = lbfgs_ls specified, but ignored since optimizer was set explicitly
Traceback (most recent call last):
File "testRegistrationGenericMultiscaleCustom.py", line 160, in
mo.optimize()
File "/afs/cs.unc.edu/home/mn/private/research/programming/git/mermaid/pyreg/multiscale_optimizer.py", line 625, in optimize
ssOpt.optimize()
File "/afs/cs.unc.edu/home/mn/private/research/programming/git/mermaid/pyreg/multiscale_optimizer.py", line 446, in optimize
self.optimizer_instance.step(self._closure)
File "/playpen/anaconda2/lib/python2.7/site-packages/torch/optim/adam.py", line 39, in step
loss = closure()
File "/afs/cs.unc.edu/home/mn/private/research/programming/git/mermaid/pyreg/multiscale_optimizer.py", line 327, in _closure
self.rec_phiWarped = self.model(self.identityMap, self.ISource)
File "/playpen/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 224, in call
result = self.forward(*input, **kwargs)
TypeError: forward() takes exactly 2 arguments (3 given)

Spatial transformer network understanding

Hello @marcniethammer,
Thank you for making the code available, really interesting work.

I was looking into some of the code, in particular for the STN in 3D. I noticed that you are moving the channels around, here:

input2_ordered[:, 0, ...] = input2[:, 2, ...]

why so?

I have also another question that is not about your code in particular but it is in general about the Pytorch grid_sample function. As you can see from my question , I am still not sure about how to correctly use grid_sample in case of registration. Have you solved this problem yourself?

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.