Relate module convert to image


Hi all,

It would be nice if we could convert to image on the “related” image, or the correlated children to parent. Currently you can’t choose in the covert to image module. However I think you can still save the whole thing as a matlab file, correct? A bit troublesome though if you want to quickly preview the image.

Kind Regards,


Hi Tim,

I agree with your suggestion that it would be useful in certain cases to have the Children and/or Parent obejects available to manipulate easily. But you could get around the issue, in this case, by doing a FilterByObjectMeasurement on the children/parent objects and filtering out those that have (or do not have) a parent/child. Then this newly created “filtered” object type could be converted to image to save.

Let us know if that works for you.


Hi David,

I’ve tried this from your suggestion, but it did not work. The filterbyobjectmeasurement doesn’t keep the children to parent relation intact.
Here is the manual save from the relate figure. It would be nice to save this image through the pipeline.

Kind Regards,


Hi Tim,

To build on what David said: You can Relate your filtered objects to the original parents to reestablish the parent/child relationship. As it stands now, any measurements you’ve used to on the original objects will need to be re-applied to the filtered objects. But back to your question: the ability to save objects based on a measurement of choice is something that sounds appropriate to add to CP.



Hi Tim,

Other solutions:
If you have Matlab, you can forego ConvertToImage and use SaveImages with the first setting set to the figure number. You need to save as a ‘fig’, and to view this you’d need Matlab (to my knowledge). Is this, though, what you indicated was troublesome in your original post?

A better solution, which I have implemented for the next release, is simply saving the label matrix (just like the image you sent) in handles.Pipeline. You can either wait for the next release, or in the Developer’s version add these lines to the end of Relate.m:


%%% The label matrix image is saved to the handles structure so it can be
%%% used by subsequent modules.
ColoredNewObjectParentLabelMatrixName = [ParentName{1} ‘_’ SubObjectName];
handles.Pipeline.(ColoredNewObjectParentLabelMatrixName) = ColoredNewObjectParentLabelMatrix;[/quote]

Then you can choose the image as “Other…” in SaveImages, and type in Parent_Child, where Parent and Child are the object names as used in the Relate settings.



Hi David & Mark,

Thanks for your advice.

Yes the save figure option is probably the only way for now to save related parent/children images. This can be opened up in matlab, and even CP (you just point your input dir to where the .fig are saved and open them up by double-clicking). I found opening .fig in CP is far more stable than in matlab.

It sounds like your suggested solution by addition of code is the way to go. I don’t know the implications of this, but all I wanted was the ability to save this image and review via preview later.
I will probably just wait till the next release…

Kind Regards,