From: Bast on
Hi guys,

so I am trying to get a portion of one image I have without using pixelregion , because we can use this only when we load images right ? with imread with a code looking like that :
in_image=imread(tif_image_CFP,'PixelRegion', {[minimumy maximumy],[minimumx maximumx]});

in my program I have an image that is being processed and then I want to view and save only some portion of this image, how can I do this ?
I tried : imagesc([minimumx maximumx], [minimumy maximumy], myimage);

but it only rescale the whole image into a smaller window !
thanks for you help
From: Ashish Uthama on
On Mon, 15 Mar 2010 13:20:31 -0400, Bast
<bastien.st-louislalonde(a)mail.mcgill.ca> wrote:

> Hi guys, so I am trying to get a portion of one image I have without
> using pixelregion , because we can use this only when we load images
> right ? with imread with a code looking like that :
> in_image=imread(tif_image_CFP,'PixelRegion', {[minimumy
> maximumy],[minimumx maximumx]});
>
> in my program I have an image that is being processed and then I want to
> view and save only some portion of this image, how can I do this ?
> I tried : imagesc([minimumx maximumx], [minimumy maximumy], myimage);
> but it only rescale the whole image into a smaller window ! thanks for
> you help


Perhaps you are looking for this:



>> myImage=magic(10)

myImage =

92 99 1 8 15 67 74 51 58 40
98 80 7 14 16 73 55 57 64 41
4 81 88 20 22 54 56 63 70 47
85 87 19 21 3 60 62 69 71 28
86 93 25 2 9 61 68 75 52 34
17 24 76 83 90 42 49 26 33 65
23 5 82 89 91 48 30 32 39 66
79 6 13 95 97 29 31 38 45 72
10 12 94 96 78 35 37 44 46 53
11 18 100 77 84 36 43 50 27 59

>> mySubImage=myImage(3:7, 8:10)

mySubImage =

63 70 47
69 71 28
75 52 34
26 33 65
32 39 66

(If you have IPT you could also look at IMCROP)
From: Bast on
"Ashish Uthama" <first.last(a)mathworks.com> wrote in message <op.u9mecu0na5ziv5(a)uthamaa.dhcp.mathworks.com>...
> On Mon, 15 Mar 2010 13:20:31 -0400, Bast
> <bastien.st-louislalonde(a)mail.mcgill.ca> wrote:
>
> > Hi guys, so I am trying to get a portion of one image I have without
> > using pixelregion , because we can use this only when we load images
> > right ? with imread with a code looking like that :
> > in_image=imread(tif_image_CFP,'PixelRegion', {[minimumy
> > maximumy],[minimumx maximumx]});
> >
> > in my program I have an image that is being processed and then I want to
> > view and save only some portion of this image, how can I do this ?
> > I tried : imagesc([minimumx maximumx], [minimumy maximumy], myimage);
> > but it only rescale the whole image into a smaller window ! thanks for
> > you help
>
>
> Perhaps you are looking for this:
>
>
>
> >> myImage=magic(10)
>
> myImage =
>
> 92 99 1 8 15 67 74 51 58 40
> 98 80 7 14 16 73 55 57 64 41
> 4 81 88 20 22 54 56 63 70 47
> 85 87 19 21 3 60 62 69 71 28
> 86 93 25 2 9 61 68 75 52 34
> 17 24 76 83 90 42 49 26 33 65
> 23 5 82 89 91 48 30 32 39 66
> 79 6 13 95 97 29 31 38 45 72
> 10 12 94 96 78 35 37 44 46 53
> 11 18 100 77 84 36 43 50 27 59
>
> >> mySubImage=myImage(3:7, 8:10)
>
> mySubImage =
>
> 63 70 47
> 69 71 28
> 75 52 34
> 26 33 65
> 32 39 66
>
> (If you have IPT you could also look at IMCROP)


yep that will do the job, thanks