FeatureSets and Caching

In general, what method of usage is intended or hoped for regarding feature sets A) should a new featureset op be created and run per label region (or whatever might be the input), or B) can/should the featureset op instance be reused over and over for multiple label regions? (@dietzc and @ctrueden)? I suppose it likely depends eventually on the particular implementation but, say for example, the Haralick2DFeatureSet on the featuresets branch.



I’m not the right person to respond to this—I don’t know the answers you seek—but just wanted to reply for closure on the thread. As a rule of thumb, the Ops framework wants you to create a new instance of each Op whenever you use it. But this might not hold true when it comes to op chaining, featuresets, etc.

In theory it may be OK to reuse an op instance, although there is some danger of “state pollution” with inputs populated from a previous run. It is the responsibility of the caller to ensure all inputs are set to the correct values each time.

Thanks. Sounds good.