Generate new image with Sine waves

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Generate new image with Sine waves

mmettlen
Hi, for educational purposes, I'd like to write a macro that allows the
following:
- Generate a new image of dimensions xy
- Fill that image with a 2D sine wave after the user specifies the Miller
indices h and k (i.e. the direction of the sine wave), it's amplitude A and
it's phase.
- Add to the above sine wave a new sine wave with new h, k, A and phase...
- Repeat above addition....

Point of that macro is to visualize how waves add to create interference.
Any help would be much appreciated! Thx! Marcel




--
Sent from: http://imagej.1557.x6.nabble.com/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Generate new image with Sine waves

Herbie
Greetings!

Have a look at:
<https://imagej.nih.gov/ij/macros/examples/MathMacroDemo.txt>

Regards

Herbie

::::::::::::::::::::::::::::::::::::::
Am 05.02.21 um 12:32 schrieb mmettlen:

> Hi, for educational purposes, I'd like to write a macro that allows the
> following:
> - Generate a new image of dimensions xy
> - Fill that image with a 2D sine wave after the user specifies the Miller
> indices h and k (i.e. the direction of the sine wave), it's amplitude A and
> it's phase.
> - Add to the above sine wave a new sine wave with new h, k, A and phase...
> - Repeat above addition....
>
> Point of that macro is to visualize how waves add to create interference.
> Any help would be much appreciated! Thx! Marcel
>
>
>
>
> --
> Sent from: http://imagej.1557.x6.nabble.com/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Generate new image with Sine waves

Fred Damen
Greetings Marcel,

Great resource, albeit very simply, Process>Math>Macro... and read the
list of provided variables in the popup, then code goes into:
run("Macro...", "code=[v="+ code + "]");

Enjoy,

Fred

PS: Plugins>Macros>Record... Process>Image Calculator...

On Fri, February 5, 2021 5:55 am, Herbie wrote:

> Greetings!
>
> Have a look at:
> <https://imagej.nih.gov/ij/macros/examples/MathMacroDemo.txt>
>
> Regards
>
> Herbie
>
> ::::::::::::::::::::::::::::::::::::::
> Am 05.02.21 um 12:32 schrieb mmettlen:
>> Hi, for educational purposes, I'd like to write a macro that allows the
>> following:
>> - Generate a new image of dimensions xy
>> - Fill that image with a 2D sine wave after the user specifies the
>> Miller
>> indices h and k (i.e. the direction of the sine wave), it's amplitude A
>> and
>> it's phase.
>> - Add to the above sine wave a new sine wave with new h, k, A and
>> phase...
>> - Repeat above addition....
>>
>> Point of that macro is to visualize how waves add to create
>> interference.
>> Any help would be much appreciated! Thx! Marcel
>>
>>
>>
>>
>> --
>> Sent from: http://imagej.1557.x6.nabble.com/
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html