mjirik/imcut

How to make the speed faster?

Opened this issue · 1 comments

Thank you very much for the imcut code. I wonder how to save some time.

For example, in the first time, I give some seed, and imcut calculate a segmentation result. Is there some result can be used in the following runs?

Previously, you said:

Some time is consumed by intensity model preparation in function igc.fit_model(). In some cases, you can fit your model only once and skip this part in the following runs.

Do you mean:

gc = pycut.ImageGraphCut(img)
gc.set_seeds(seeds)
gc.run()
...
# then, the segmentation result may need to be revised, and user prepare new seeds
gc.set_seeds(newseeds)
gc.run(run_fit_model=False)

But the code is:

        if run_fit_model:
            self.fit_model(self.img, self.voxelsize, self.seeds)

It means the fitted model is specified for the seeds. If the seeds is different, I think the fitted model is useless. Am I right?

In addition, since the some seeds in the first & second runs are the same, is there any other middle calculation parameters can be used in the following runs?

In the explanation:

use_apriori_if_available - set self.apriori to ndimage with same shape as img
:param keep_graph_properties: Do not delete some usefull varibales like
                msinds, unariesalt, nlinks, temp_msgc_resized_segmentation, temp_msgc_resized_img and
                temp_msgc_resized_seeds

if I set keep_graph_properties to True, how can I use the saved usefull variable (...)? And what is the use_apriori_if_available means? What the self.apriori should be?

Hi, there are several parts of the module not well documented. Thank you for pointing it out.
New examples were added. I think these two should help you: