From ImageJ to Matlab Conversion

1 vue (au cours des 30 derniers jours)
Stelios Fanourakis
Stelios Fanourakis le 12 Juil 2018
HI.
Can someone translate this ImageJ piece of code to MATLAB equivalent. If not, is there an app for automated conversion between those two formats?
Thank you
for(i=1;i<=nSlices;i++){
setSlice(i);
run("Translate...", "x="+i*xTranslate+" y="+i*yTranslate+"
interpolation=None slice");
}
  6 commentaires
Guillaume
Guillaume le 12 Juil 2018
Oh, I didn't realised it was you. Well, as you've requested, I will not get involved in your questions.

Connectez-vous pour commenter.

Réponses (1)

Sean de Wolski
Sean de Wolski le 12 Juil 2018
Modifié(e) : Sean de Wolski le 12 Juil 2018
Looks like imtranslate should work. My interpretation of that is: loop over slices, translate each slice by some amount (that value may vary by slice - I don't know). You may not be able to do it all in one shot but it should certainly work. Something along these lines, not tested.
VT = zeros(size(V),'like',V)
for ii = 1:size(V,3)
VT(:,:,ii) = imtranslate(V(:,:,ii), [something_row(ii), something_col(ii)])
end
Can you describe what you're trying to do, i.e. what is the end goal?
  15 commentaires
Stelios Fanourakis
Stelios Fanourakis le 13 Juil 2018
@Sean. I tried your answer but it doesn't work for me. It doesn't translate separate slices
Stelios Fanourakis
Stelios Fanourakis le 15 Juil 2018
@Sean. I though of another solution. When I use result = F(g) I apply interpolation again to g which are the original set points (image) multiplied by translation_vector.
That means that the original image has already been shifted plus a new interpolation coming on the way (F(g)). Does it make it somehow to be smushed or squeezed?
If I visualize with only g without F(g) I get errors later on to the uicontrol of the slider (e.g. Index Exceeds Matrix Dimensions).
Would it be correct to visualize only with g?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by