need help for the macro smart segmentaion and counting

I wanted to create an semiautomated app where it should prompt me for spatial calibration to add, then to use best fit, and the for ROI. then it should do smart segmentaion and coutning. I also created data table and closing file to create a loop for the batch processing. whjen I run it, images are just opening and nothing happens. I am new to create macro....attcahed my work flow and code. I definitely see something wrong from long list of coding but could not figure out how to correct it.

can some one have a look at and help me?

thanks in adnavce

Best Answer

  • Accepted Answer
    Cms,

    It looks like you started a complex project as your first macro. I would recommend going through some tutorials and webinars on our web site that may provide you with some useful tips, please check our media library and search for "macro": http://www.mediacy.com/resources/media?medl_keyword_search=macro&medl_page= . You can also search these forum, that has many discussions regarding macro programming and interactivity.

    Another advice is to try to split the project into small steps, so you can debug them one by one, in that case it would be much easier to find where the problem is.

    Regarding interaction: any command can be made interactive by activating "Prompt user in imaging workspace" option from the context menu in the designer. There is also "Interaction" command that can be dropped from the toolbox in the designer view.

    Yuri

Answers

  • Thank you Yuri,

    I made some simple macros and they are fine. I have one question regarding data collection. I am creating ROI with the select tab using polygonal ttool and then couting objects. it works but what I also need is the just the area (outline area) of the ROI as I have different ROI for each image and later I wanted quantify objects per the ROI from each image. Some how I could not just have that area. I see area of polygonal, etc data collection tabs but nothing gives me, it is just giving me the no of count or segmentaion of that area but not the area of outline.

    I retied different area tool s from the meusurment types and checked, I could not get that, which in general should be very simple to have that.

    Can you please help me If I got to choose or do differently. btb I was working on the same pictu that have attached before.

    Thanking you


  • Hi cms,

    One of the way is to convert ROI in to measurements polygon using Features Manager.

    Thanks,
    Nikita.
  • CMS,

    The area of ROI is not reported directly, but it can be calculated from "Area" and "Percent Area" of the objects inside the ROI, for example you can measure Sum values and calculate 

    AreaOfROI = Area(sum)/"Percent Area ratio (sum)"

    This formula can be added directly to Data Collector.

    Another way is more straight forward:

    1. You draw your sample polygon using Measurements polygon tool (not ROI polygon) - it will immediately give you area of that polygon.
    2. Activate "Preserve existing data" and "Use as outlines" options on the measurement options panel and click Count - it will measure all the objects inside the polygon defined on step 1. Data table will have both classes.

    Yuri

  • NikitaRG said:
    Hi cms,

    One of the way is to convert ROI in to measurements polygon using Features Manager.

    Thanks,
    Nikita.


    Dear Nikita,

    Thank you,  I tried and it works but but I nee thus along other measurments, of course then I got to creeates two tables. But anyway thanks for the help

  • Hi Yuri,
    Thank you very much. The second one helped me.
    The first formula somehow not giving me the same or correct value in my case the area.
    I checked with calibration and found by the second option gives me the right value.
    Thanking you,
    Best
    CMS
    YuriG said:
    CMS,

    The area of ROI is not reported directly, but it can be calculated from "Area" and "Percent Area" of the objects inside the ROI, for example you can measure Sum values and calculate 

    AreaOfROI = Area(sum)/"Percent Area ratio (sum)"

    This formula can be added directly to Data Collector.

    Another way is more straight forward:

    1. You draw your sample polygon using Measurements polygon tool (not ROI polygon) - it will immediately give you area of that polygon.
    2. Activate "Preserve existing data" and "Use as outlines" options on the measurement options panel and click Count - it will measure all the objects inside the polygon defined on step 1. Data table will have both classes.

    Yuri






    YuriG said:
    CMS,

    The area of ROI is not reported directly, but it can be calculated from "Area" and "Percent Area" of the objects inside the ROI, for example you can measure Sum values and calculate 

    AreaOfROI = Area(sum)/"Percent Area ratio (sum)"

    This formula can be added directly to Data Collector.

    Another way is more straight forward:

    1. You draw your sample polygon using Measurements polygon tool (not ROI polygon) - it will immediately give you area of that polygon.
    2. Activate "Preserve existing data" and "Use as outlines" options on the measurement options panel and click Count - it will measure all the objects inside the polygon defined on step 1. Data table will have both classes.

    Yuri


    YuriG said:
    CMS,

    The area of ROI is not reported directly, but it can be calculated from "Area" and "Percent Area" of the objects inside the ROI, for example you can measure Sum values and calculate 

    AreaOfROI = Area(sum)/"Percent Area ratio (sum)"

    This formula can be added directly to Data Collector.

    Another way is more straight forward:

    1. You draw your sample polygon using Measurements polygon tool (not ROI polygon) - it will immediately give you area of that polygon.
    2. Activate "Preserve existing data" and "Use as outlines" options on the measurement options panel and click Count - it will measure all the objects inside the polygon defined on step 1. Data table will have both classes.

    Yuri



Sign In or Register to comment.