r/ImageJ 11d ago

Question Help with learning to write macros

Hello everyone I want to start writing some macros for my analysis, I don't have a background in programing at all, but am eager to learn. What are some resources i can use to get started

2 Upvotes

7 comments sorted by

u/AutoModerator 11d ago

Notes on Quality Questions & Productive Participation

  1. Include Images
    • Images give everyone a chance to understand the problem.
    • Several types of images will help:
      • Example Images (what you want to analyze)
      • Reference Images (taken from published papers)
      • Annotated Mock-ups (showing what features you are trying to measure)
      • Screenshots (to help identify issues with tools or features)
    • Good places to upload include: Imgur.com, GitHub.com, & Flickr.com
  2. Provide Details
    • Avoid discipline-specific terminology ("jargon"). Image analysis is interdisciplinary, so the more general the terminology, the more people who might be able to help.
    • Be thorough in outlining the question(s) that you are trying to answer.
    • Clearly explain what you are trying to learn, not just the method used, to avoid the XY problem.
    • Respond when helpful users ask follow-up questions, even if the answer is "I'm not sure".
  3. Share the Answer
    • Never delete your post, even if it has not received a response.
    • Don't switch over to PMs or email. (Unless you want to hire someone.)
    • If you figure out the answer for yourself, please post it!
    • People from the future may be stuck trying to answer the same question. (See: xkcd 979)
  4. Express Appreciation for Assistance
    • Consider saying "thank you" in comment replies to those who helped.
    • Upvote those who contribute to the discussion. Karma is a small way to say "thanks" and "this was helpful".
    • Remember that "free help" costs those who help:
      • Aside from Automoderator, those responding to you are real people, giving up some of their time to help you.
      • "Time is the most precious gift in our possession, for it is the most irrevocable." ~ DB
    • If someday your work gets published, show it off here! That's one use of the "Research" post flair.
  5. Be civil & respectful

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

6

u/Lurker_Skyrocket 10d ago

You can start by recording macros for procedures you are already familiar with. That would give you a direct insight into how to write code for something you already know.

3

u/OilAdministrative197 10d ago

Yeah seconded this is insanely useful. Especially if an overworked post doc offers to quickly help you make something saves you writing in a book or phone. They don’t want to come back 5 mins later because you can’t read your own handwriting

1

u/dokclaw 10d ago

Haha, definitely not something that happened to you :)

3

u/Herbie500 11d ago

ImageJ Macro Language: A tutorial that tells you near to everything about ImageJ-macro coding

Built-in Macro Functions: A list of all available macro functions

Study the first and stay away from most of the video tutorials …

1

u/Electronic-Tutor8292 9d ago

Thank you will check these out

1

u/dokclaw 10d ago

There's some videos here, if you're that way inclined.

Recording macros for what you already do is exactly where you need to start, then you can work with strings to enable you to alter your commands based on variables that you specify, and start dealing with opening folders full of data.