Search code examples
matlabsizetextures

fixed size window in figure MATLAB


I have a program to do in my memory and i really need your helps.

My question is about : how can i have a 64x64 window around a pixel in my figure image on MATLAB.

Because i want to select a pixel (just one pixel) in my image, then when i click on this pixel, my program take the others neighbor pixel.

What i want to say is : the pixel that I have to select it is only to create a 64x64 window around it automatically. I need this to complete my analyze of texture MRI image.

If some one can not understand I'm here to explain more and I'm sorry for my English if it's not clear.


Solution

  • clear all
    close all
    clc
    bitmap=uigetfile('*.*');
    I = imread(bitmap);
    figure, imshow(I)
    [x,y]=ginput(1);
    %[Nx,Ny] = size(I(round(y)-5:round(y)+5,round(x)-5:round(x)+5));
    %I1=I(round(y(1)),round(x(1)));
    myMask = I(x-32:x+32,y-32:y+32);
    [ D ] = sfta( myMask, 1);    
    
    so what do you think about my code ?