Home Image-Pro Automation (Macros, Apps, Reports)

Image-Pro freezes or chrashes during processing

An APP processes image files (czi's). A channel is extracted, measured, a mask is created (converted from 8bit to 16bit), and linked to another channel.

Sometimes Image-Pro crashes or freezes. I have tested it on several different PCs. The PCs show different behavior. On one PC Image-Pro freezes and on another it crashes. Sometimes sooner or sometimes later.

The log shows me that the error sometimes occurs when the mask is converted from 8bit to 16bit.

  <Event Date="2019/11/4" Time="9:19:59.47" Source="Image-Pro 64-bit" Type="Information" Category="0x10" EventID="0x0" User="fsp" Computer="fsp">
Measure.MeasurementsCommands.ExecuteCount(Channel_3) {}
  </Event>
  <Event Date="2019/11/4" Time="9:19:59.78" Source="Image-Pro 64-bit" Type="Information" Category="0x10" EventID="0x0" User="fsp" Computer="fsp">
Measure.Measurements.CreateCommands.Mask(Channel_3)=Channel_3_Mask {}
  </Event>
  <Event Date="2019/11/4" Time="9:19:59.203" Source="Image-Pro 64-bit" Type="Information" Category="0x10" EventID="0x0" User="fsp" Computer="fsp">
Application.DocumentCommands.Activate(Channel_3_Mask)=Channel_3_Mask {}
  </Event>
  <Event Date="2019/11/4" Time="9:20:2.453" Source="Image-Pro 64-bit" Type="Information" Category="0x10" EventID="0x0" User="fsp" Computer="fsp">
Adjust.ImageCommands.Convert(Channel_3_Mask)=Channel_3_Mask_16Gray {Destination = Mono16,ConvertOption = Scale,Visible = True}
  </Event>
  <Event Date="2019/11/4" Time="9:20:2.578" Source="Image-Pro 64-bit" Type="Information" Category="0x10" EventID="0x0" User="fsp" Computer="fsp">
Application.DocumentCommands.Activate(Channel_3_Mask_16Gray)=Channel_3_Mask_16Gray {}
  </Event>
 </EventLog>

How can I fix this? Any ideas?
Attached you can find a simple demo project which I use for testing. Where can I upload the big sized czi image?

Try "Number of loops: 200".
Image-Pro Version: 10.0.4.6912

Thanks in advance
fsup

Answers

  • Hi fsup,

    I will look at your issue. 

    Click here to upload CZI image.

    Yuri

  • Hi fsup,

    Thank you for providing a test image. I executed your test with 200 loops, it took over 3 hours, but the test was completed correctly without crash. I've attached the log from the output window. (My PC has 32GB RAM).

    What I noticed in your macro is that you set segmentation options (thresholds, measurement list) in the code. The macro doesn't set all options (like FillHoles, Smoothing,...), so the result may depend on the existing measurement options. I would recommend to add some code to ensure that all settings are always the same. (I reset options manually). The best way to do that is by loading of an IQO file with all measurement options before execution of Count command. The IQO file includes all segmentation options (Thresholds, Classes, Measurement list,...)
        Public Function LoadCountOptions() As SimpleScript
            LoadCountOptions = New SimpleScript
            Dim doc1
    
            With Application.DocumentCommands.Active(LoadCountOptions)
                .Run(doc1)
            End With
    
            'load options
            With Measure.Measurements.OptionsCommands.Open(LoadCountOptions)
                .FileName = ThisApplication.Path(mcPathType.mcptConfigurationFiles) & "Sample_segmentation.iqo"
                .FilterIndex = 1
                .Run(doc1)
            End With
    
            'continue with Count
            With Measure.MeasurementsCommands.ExecuteCount(LoadCountOptions)
                .Run(doc1)
            End With
        End Function
    

    Note, that when you load the options from default folder (Configuration Files) during macro recording, the options file will be automatically included into the IPX file and redistributed with the macro (or you can add it manually into Additional Files collection of the project). You can use different IQO files for different channels.

    Please try to reset the options before running the macro or add the code to load IQO file and let me know if you have any changes. How much RAM do you have?

    Regards,

    Yuri

  • Hi Yuri,

    I tried your solution and integrated a reset. Unfortunately, the adjustment has no effect.
            ' reset options
            With MediaCy.Automation.Measure.Measurements.OptionsCommands.Reset(Nothing)
                .Run(srcImage)
            End With
    
    Please start the application more often. In the Windows Taskmanager there is the call "Analyze Wait Chain". If the software freezes "Analyze Wait Chain" gives out a deadlock (see screenshot).



    RAM: 32GB

    What else can I do?

    Best regards,
    fsup

  • Hi fsup,

    We did more tests with your macro in Image-Pro 10.0.4 and could reproduce the problem. We will investigate it and try to fix the issue in the next release, but for now, we can recommend a workaround to avoid lock ups, which worked in out tests. 

    Please try switching off "Batch Process All" option (Application options, Task Scheduling page). It will disable background commands, which could interfere with the running macro.
    Let me know if it fixes the problem.

    Best regards,

    Yuri
  • Yeah great. I will test that and let you know.

    Best regards,
    fsup
  • edited November 2019
    Hi Yuri,

    I did some tests.There are fewer crashes compared to before. If IP freezes "Analyze Wait Chain" gives out a wait state and nothing happens. I can only quit the program via the task manager and restart it.



    Do you have another idea?

    Best regards,
    fsup
Sign In or Register to comment.