You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by Zvi Baratz <z....@gmail.com> on 2019/10/03 09:25:54 UTC

Plotting 2D arrays

Hi,

I hope this isn't a silly question, but I've been digging through the
documentation and couldn't seem to be able to find a reasonable solution -
I have MRI scans in the form of 3D matrices, and I would like to create an
interactive "slice viewer" that can display 2D slices of the data in the
three planes.

Here is an example I created in the past using Bokeh
<https://bokeh.pydata.org/en/latest/>:
[image: image.png]
Is there a suitable component type to achieve this with Echarts?

Thank you very much for your help and all your wonderful work,
Zvi

Re: Plotting 2D arrays

Posted by Ovilia <ov...@gmail.com>.
Hi Zvi,

If I understand correctly, I think you don't need ECharts in your case
because it's not a "chart".
I think pure Canvas could do the job. You can find more detail with this
Canvas tutorial:
https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Pixel_manipulation_with_canvas
 .


Wenli


On Fri, Oct 4, 2019 at 6:07 PM Zvi Baratz <z....@gmail.com> wrote:

> Hi Wenli,
>
> Thank you for your reply!
> Actually, the MRI images are not images (not image files, such as jpg or
> png), but 2D arrays. Just like [[1, 0, 0], [0, 1, 0], [0, 0, 1]] is a 3x3
> array that would draw a diagonal line if plotted, these are 2D arrays of
> 256x256 and sometimes much bigger. I am looking for a way to plot those
> images (2D arrays) using a desired colorscale (values don't have to be 0
> and 1).
>
> Hope this makes things clearer and thank you again for you help,
> Zvi
>
> On Fri, Oct 4, 2019 at 7:02 AM Ovilia <ov...@gmail.com> wrote:
>
>> Hi Zvi.
>>
>> What part of the graph do you wish to create using ECharts?
>> I think the gray MRI images are all images, and maybe you wish to create
>> the green lines using ECharts?
>> If so, I may suggest using pure canvas to draw the two green lines,
>> because it may be over-kill to use ECharts in this case.
>> If not, please let me know what part do you wish to create using ECharts.
>>
>> Thanks!
>>
>> Wenli
>>
>>
>> On Thu, Oct 3, 2019 at 10:59 PM Zvi Baratz <z....@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I hope this isn't a silly question, but I've been digging through the
>>> documentation and couldn't seem to be able to find a reasonable solution -
>>> I have MRI scans in the form of 3D matrices, and I would like to create
>>> an interactive "slice viewer" that can display 2D slices of the data in the
>>> three planes.
>>>
>>> Here is an example I created in the past using Bokeh
>>> <https://bokeh.pydata.org/en/latest/>:
>>> [image: image.png]
>>> Is there a suitable component type to achieve this with Echarts?
>>>
>>> Thank you very much for your help and all your wonderful work,
>>> Zvi
>>>
>>

Re: Plotting 2D arrays

Posted by Ovilia <ov...@gmail.com>.
Hi Zvi.

What part of the graph do you wish to create using ECharts?
I think the gray MRI images are all images, and maybe you wish to create
the green lines using ECharts?
If so, I may suggest using pure canvas to draw the two green lines, because
it may be over-kill to use ECharts in this case.
If not, please let me know what part do you wish to create using ECharts.

Thanks!

Wenli


On Thu, Oct 3, 2019 at 10:59 PM Zvi Baratz <z....@gmail.com> wrote:

> Hi,
>
> I hope this isn't a silly question, but I've been digging through the
> documentation and couldn't seem to be able to find a reasonable solution -
> I have MRI scans in the form of 3D matrices, and I would like to create an
> interactive "slice viewer" that can display 2D slices of the data in the
> three planes.
>
> Here is an example I created in the past using Bokeh
> <https://bokeh.pydata.org/en/latest/>:
> [image: image.png]
> Is there a suitable component type to achieve this with Echarts?
>
> Thank you very much for your help and all your wonderful work,
> Zvi
>