Re: [julia-users] 3D image matrix

2015-12-07 Thread Rivo Sarmento
Hi André,

The output of `methos(view)` in both version are:

Julia version 0.3

julia> methods(view)
# 3 methods for generic function "view":
view{A<:AbstractArray{T,N}}(img::A<:AbstractArray{T,N}) at 
/home/rivo/.julia/v0.3/ImageView/src/display.jl:233
view{A<:AbstractArray{T,N}}(imgc::ImageCanvas,img::A<:AbstractArray{T,N}) 
at /home/rivo/.julia/v0.3/ImageView/src/display.jl:344
view{A<:AbstractArray{T,N}}(c::Canvas,img::A<:AbstractArray{T,N}) at 
/home/rivo/.julia/v0.3/ImageView/src/display.jl:364


Julia version 0.4
# 3 methods for generic function "view":
view{A<:AbstractArray{T,N}}(img::A<:AbstractArray{T,N}) at 
/home/rivo/.julia/v0.4/ImageView/src/display.jl:233
view{A<:AbstractArray{T,N}}(imgc::ImageView.ImageCanvas, 
img::A<:AbstractArray{T,N}) at 
/home/rivo/.julia/v0.4/ImageView/src/display.jl:344
view{A<:AbstractArray{T,N}}(c::Tk.Canvas, img::A<:AbstractArray{T,N}) at 
/home/rivo/.julia/v0.4/ImageView/src/display.jl:364


And yes, it is version 0.3.2.

You're welcome,
 

Em quinta-feira, 3 de dezembro de 2015 14:22:22 UTC-3, André Lage escreveu:
>
> hi Rivo,
>
> Could you try to run this code (plot the image) in Julia 0.4.1?
>
> What's the output of `methods(view)` in both versions 0.3.? and 0.4.1 (are 
> you sure it's Julia 0.3.2 or it'd be 0.3.8 instead)?
>
> Thanks,
>
>
> André.
>
> On Wednesday, December 2, 2015 at 11:06:13 AM UTC-3, Rivo Sarmento wrote:
>>
>> ImageView.view(img) works also, thanks!
>>
>> This is a Polarimetric SAR image from San Andreas Fault, CA. 
>>
>> Em terça-feira, 1 de dezembro de 2015 23:08:59 UTC-3, Benjamin Deonovic 
>> escreveu:
>>>
>>> So whats the image of? 
>>>
>>> On Tuesday, December 1, 2015 at 4:50:51 PM UTC-6, Rivo Sarmento wrote:

 Currently the imports, or using package, are in the begining of the 
 code.
 I got it to work only if using is the last step before using `view`.

 I can't think of a particular reason for it to happen. Although, in my 
 0.3.2 Julia importing ImageView returns:

 julia> using ImageView
 Warning: could not import Base.Text into Tk

 I finally got, as we can see in the attached file, thank you very much.

 Em terça-feira, 1 de dezembro de 2015 19:19:03 UTC-3, Tim Holy escreveu:
>
> On Tuesday, December 01, 2015 01:36:28 PM Rivo Sarmento wrote: 
> > But `view` returns: 
> > 
> > julia> view(img) 
> > ERROR: `view` has no method matching 
> > view(::Image{Float64,3,Array{Float64,3}}) 
>
> Are you sure you first said 
> using ImageView? 
>
> julia> methods(view) 
> # 3 methods for generic function "view": 
> view{A<:AbstractArray{T,N}}(img::A<:AbstractArray{T,N}) at 
> /home/tim/.julia/v0.4/ImageView/src/display.jl:233 
> view{A<:AbstractArray{T,N}}(imgc::ImageView.ImageCanvas, 
> img::A<:AbstractArray{T,N}) at 
> /home/tim/.julia/v0.4/ImageView/src/display.jl:344 
> view{A<:AbstractArray{T,N}}(c::Tk.Canvas, img::A<:AbstractArray{T,N}) 
> at 
> /home/tim/.julia/v0.4/ImageView/src/display.jl:364 
>
> That first method covers any AbstractArray. 
>
> --Tim 
>
>

Re: [julia-users] 3D image matrix

2015-12-03 Thread André Lage
hi Rivo,

Could you try to run this code (plot the image) in Julia 0.4.1?

What's the output of `methods(view)` in both versions 0.3.? and 0.4.1 (are 
you sure it's Julia 0.3.2 or it'd be 0.3.8 instead)?

Thanks,


André.

On Wednesday, December 2, 2015 at 11:06:13 AM UTC-3, Rivo Sarmento wrote:
>
> ImageView.view(img) works also, thanks!
>
> This is a Polarimetric SAR image from San Andreas Fault, CA. 
>
> Em terça-feira, 1 de dezembro de 2015 23:08:59 UTC-3, Benjamin Deonovic 
> escreveu:
>>
>> So whats the image of? 
>>
>> On Tuesday, December 1, 2015 at 4:50:51 PM UTC-6, Rivo Sarmento wrote:
>>>
>>> Currently the imports, or using package, are in the begining of the code.
>>> I got it to work only if using is the last step before using `view`.
>>>
>>> I can't think of a particular reason for it to happen. Although, in my 
>>> 0.3.2 Julia importing ImageView returns:
>>>
>>> julia> using ImageView
>>> Warning: could not import Base.Text into Tk
>>>
>>> I finally got, as we can see in the attached file, thank you very much.
>>>
>>> Em terça-feira, 1 de dezembro de 2015 19:19:03 UTC-3, Tim Holy escreveu:

 On Tuesday, December 01, 2015 01:36:28 PM Rivo Sarmento wrote: 
 > But `view` returns: 
 > 
 > julia> view(img) 
 > ERROR: `view` has no method matching 
 > view(::Image{Float64,3,Array{Float64,3}}) 

 Are you sure you first said 
 using ImageView? 

 julia> methods(view) 
 # 3 methods for generic function "view": 
 view{A<:AbstractArray{T,N}}(img::A<:AbstractArray{T,N}) at 
 /home/tim/.julia/v0.4/ImageView/src/display.jl:233 
 view{A<:AbstractArray{T,N}}(imgc::ImageView.ImageCanvas, 
 img::A<:AbstractArray{T,N}) at 
 /home/tim/.julia/v0.4/ImageView/src/display.jl:344 
 view{A<:AbstractArray{T,N}}(c::Tk.Canvas, img::A<:AbstractArray{T,N}) 
 at 
 /home/tim/.julia/v0.4/ImageView/src/display.jl:364 

 That first method covers any AbstractArray. 

 --Tim 



Re: [julia-users] 3D image matrix

2015-12-02 Thread Rivo Sarmento
ImageView.view(img) works also, thanks!

This is a Polarimetric SAR image from San Andreas Fault, CA. 

Em terça-feira, 1 de dezembro de 2015 23:08:59 UTC-3, Benjamin Deonovic 
escreveu:
>
> So whats the image of? 
>
> On Tuesday, December 1, 2015 at 4:50:51 PM UTC-6, Rivo Sarmento wrote:
>>
>> Currently the imports, or using package, are in the begining of the code.
>> I got it to work only if using is the last step before using `view`.
>>
>> I can't think of a particular reason for it to happen. Although, in my 
>> 0.3.2 Julia importing ImageView returns:
>>
>> julia> using ImageView
>> Warning: could not import Base.Text into Tk
>>
>> I finally got, as we can see in the attached file, thank you very much.
>>
>> Em terça-feira, 1 de dezembro de 2015 19:19:03 UTC-3, Tim Holy escreveu:
>>>
>>> On Tuesday, December 01, 2015 01:36:28 PM Rivo Sarmento wrote: 
>>> > But `view` returns: 
>>> > 
>>> > julia> view(img) 
>>> > ERROR: `view` has no method matching 
>>> > view(::Image{Float64,3,Array{Float64,3}}) 
>>>
>>> Are you sure you first said 
>>> using ImageView? 
>>>
>>> julia> methods(view) 
>>> # 3 methods for generic function "view": 
>>> view{A<:AbstractArray{T,N}}(img::A<:AbstractArray{T,N}) at 
>>> /home/tim/.julia/v0.4/ImageView/src/display.jl:233 
>>> view{A<:AbstractArray{T,N}}(imgc::ImageView.ImageCanvas, 
>>> img::A<:AbstractArray{T,N}) at 
>>> /home/tim/.julia/v0.4/ImageView/src/display.jl:344 
>>> view{A<:AbstractArray{T,N}}(c::Tk.Canvas, img::A<:AbstractArray{T,N}) at 
>>> /home/tim/.julia/v0.4/ImageView/src/display.jl:364 
>>>
>>> That first method covers any AbstractArray. 
>>>
>>> --Tim 
>>>
>>>

Re: [julia-users] 3D image matrix

2015-12-01 Thread Tim Holy
On Tuesday, December 01, 2015 01:36:28 PM Rivo Sarmento wrote:
> But `view` returns:
> 
> julia> view(img)
> ERROR: `view` has no method matching
> view(::Image{Float64,3,Array{Float64,3}})

Are you sure you first said
using ImageView?

julia> methods(view)
# 3 methods for generic function "view":
view{A<:AbstractArray{T,N}}(img::A<:AbstractArray{T,N}) at 
/home/tim/.julia/v0.4/ImageView/src/display.jl:233
view{A<:AbstractArray{T,N}}(imgc::ImageView.ImageCanvas, 
img::A<:AbstractArray{T,N}) at 
/home/tim/.julia/v0.4/ImageView/src/display.jl:344
view{A<:AbstractArray{T,N}}(c::Tk.Canvas, img::A<:AbstractArray{T,N}) at 
/home/tim/.julia/v0.4/ImageView/src/display.jl:364

That first method covers any AbstractArray.

--Tim



Re: [julia-users] 3D image matrix

2015-12-01 Thread Rivo Sarmento
Yes, the third dimension is of size 3. 

The `grayim` returns:

julia> img = grayim(pauliRGBeq)
Gray Image with:
  data: 825x1000x3 Array{Float64,3}
  properties:
colorspace: Gray
spatialorder:  x y z


But `view` returns:

julia> view(img)
ERROR: `view` has no method matching 
view(::Image{Float64,3,Array{Float64,3}})


This probably is relevant: The data is originally in gray scale, but we use 
a decomposition to artifictiallty color it (Pauli Decomposition). The 
function used to do it uses `reshape` to return the 3 Arrays together as 
the same variable for the image:

pauliRGBeq = reshape([[A_Band],[B_Band],[C_Band]],(width,height,3))


And pauliRGBeq is the variable we want to view in a new window or plot in 
order to select regions (that's the reason we need to either use mouse 
events or mark it with a coordinate system to select)

Also, note that we are able to write it to a file using
 

imwrite(pauliRGBeq, "/home/folder/testimage.png")


Best, 

Em segunda-feira, 30 de novembro de 2015 18:17:00 UTC-3, Tim Holy escreveu:
>
> You'll need 
> using ImageView 
> and then what you see will depend on the content. It looks like Images may 
> have interpreted it as an RGB image; does the 3rd dimension have size 3, 
> by 
> any chance? (This is a Matlab convention.) You can use `grayim`, for 
> example: 
>
> julia> img = grayim(rand(5,5,3)) 
> Gray Images.Image with: 
>   data: 5x5x3 Array{Float64,3} 
>   properties: 
> colorspace: Gray 
> spatialorder:  x y z 
>
> Best, 
> --Tim 
>
> On Monday, November 30, 2015 12:49:16 PM Rivo Sarmento wrote: 
> > Greetings, 
> > 
> > I'm having trouble ploting a 3 dimentional matrix in Julia. The variable 
> is 
> > of the format Array{Float64,3}, and I need to visualize it in a window. 
> > Using the Images.jl package 
> > 
> > image = convert(Image, MyVariable) 
> > 
> > RGB Image with: 
> >   data: WidthxHeightx3 Array{Float64,3} 
> >   properties: 
> > timedim: 0 
> > colorspace: RGB 
> > colordim: 3 
> > spatialorder:  y x 
> > pixelspacing:  1.0 1.0 
> > 
> > 
> > And if I try to view it 
> > 
> > view(image) 
> > 
> > ERROR: `view` has no method matching 
> > view(::Image{Float64,3,Array{Float64,3}}) 
> > 
> > 
> > I work with R and to view the same kind of images we use a function from 
> a 
> > discontinued package (the function is attached) 
> > 
> > Question #1: What's the proper way to view this type of image. 
> > Question #2: I need it to be ploted or viewed in a window that can 
> handle 
> > mouse iteractivity, how can I do it? 
> > 
> > Regards 
>
>

Re: [julia-users] 3D image matrix

2015-12-01 Thread Tim Holy
You can always say ImageView.view(img) if you need to scope the call. Perhaps 
you're using another package that exports `view`.

Best,
--Tim

On Tuesday, December 01, 2015 02:50:51 PM Rivo Sarmento wrote:
> Currently the imports, or using package, are in the begining of the code.
> I got it to work only if using is the last step before using `view`.
> 
> I can't think of a particular reason for it to happen. Although, in my
> 0.3.2 Julia importing ImageView returns:
> 
> julia> using ImageView
> Warning: could not import Base.Text into Tk
> 
> I finally got, as we can see in the attached file, thank you very much.
> 
> Em terça-feira, 1 de dezembro de 2015 19:19:03 UTC-3, Tim Holy escreveu:
> > On Tuesday, December 01, 2015 01:36:28 PM Rivo Sarmento wrote:
> > > But `view` returns:
> > > 
> > > julia> view(img)
> > > ERROR: `view` has no method matching
> > > view(::Image{Float64,3,Array{Float64,3}})
> > 
> > Are you sure you first said
> > 
> > using ImageView?
> > 
> > julia> methods(view)
> > # 3 methods for generic function "view":
> > view{A<:AbstractArray{T,N}}(img::A<:AbstractArray{T,N}) at
> > /home/tim/.julia/v0.4/ImageView/src/display.jl:233
> > view{A<:AbstractArray{T,N}}(imgc::ImageView.ImageCanvas,
> > img::A<:AbstractArray{T,N}) at
> > /home/tim/.julia/v0.4/ImageView/src/display.jl:344
> > view{A<:AbstractArray{T,N}}(c::Tk.Canvas, img::A<:AbstractArray{T,N}) at
> > /home/tim/.julia/v0.4/ImageView/src/display.jl:364
> > 
> > That first method covers any AbstractArray.
> > 
> > --Tim



Re: [julia-users] 3D image matrix

2015-12-01 Thread Benjamin Deonovic
So whats the image of? 

On Tuesday, December 1, 2015 at 4:50:51 PM UTC-6, Rivo Sarmento wrote:
>
> Currently the imports, or using package, are in the begining of the code.
> I got it to work only if using is the last step before using `view`.
>
> I can't think of a particular reason for it to happen. Although, in my 
> 0.3.2 Julia importing ImageView returns:
>
> julia> using ImageView
> Warning: could not import Base.Text into Tk
>
> I finally got, as we can see in the attached file, thank you very much.
>
> Em terça-feira, 1 de dezembro de 2015 19:19:03 UTC-3, Tim Holy escreveu:
>>
>> On Tuesday, December 01, 2015 01:36:28 PM Rivo Sarmento wrote: 
>> > But `view` returns: 
>> > 
>> > julia> view(img) 
>> > ERROR: `view` has no method matching 
>> > view(::Image{Float64,3,Array{Float64,3}}) 
>>
>> Are you sure you first said 
>> using ImageView? 
>>
>> julia> methods(view) 
>> # 3 methods for generic function "view": 
>> view{A<:AbstractArray{T,N}}(img::A<:AbstractArray{T,N}) at 
>> /home/tim/.julia/v0.4/ImageView/src/display.jl:233 
>> view{A<:AbstractArray{T,N}}(imgc::ImageView.ImageCanvas, 
>> img::A<:AbstractArray{T,N}) at 
>> /home/tim/.julia/v0.4/ImageView/src/display.jl:344 
>> view{A<:AbstractArray{T,N}}(c::Tk.Canvas, img::A<:AbstractArray{T,N}) at 
>> /home/tim/.julia/v0.4/ImageView/src/display.jl:364 
>>
>> That first method covers any AbstractArray. 
>>
>> --Tim 
>>
>>

[julia-users] 3D image matrix

2015-11-30 Thread Rivo Sarmento
Greetings,

I'm having trouble ploting a 3 dimentional matrix in Julia. The variable is 
of the format Array{Float64,3}, and I need to visualize it in a window. 
Using the Images.jl package

image = convert(Image, MyVariable)

RGB Image with:
  data: WidthxHeightx3 Array{Float64,3}
  properties:
timedim: 0
colorspace: RGB
colordim: 3
spatialorder:  y x
pixelspacing:  1.0 1.0


And if I try to view it

view(image)

ERROR: `view` has no method matching 
view(::Image{Float64,3,Array{Float64,3}})


I work with R and to view the same kind of images we use a function from a 
discontinued package (the function is attached)

Question #1: What's the proper way to view this type of image.
Question #2: I need it to be ploted or viewed in a window that can handle 
mouse iteractivity, how can I do it?

Regards




imagematrix.R
Description: Binary data