<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">Hi Itk users<div>I just checked the itk object factory code and have some confusions> I think ITK should be right and anyone can help explain it?</div><div><br></div><div>in the itkObjectFactoryBase.cxx</div><div><div>void ObjectFactoryBase::RegisterOverride(</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>const char* classOverride,</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>const char* subclass,</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>const char* description,</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>bool enableFlag,</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>CreateObjectFunctionBase* createFunction)</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>ObjectFactoryBase::OverrideInformation info;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>info.m_Description<span class="Apple-tab-span" style="white-space:pre">          </span>= description;</div><div><span class="Apple-tab-span" style="white-space:pre">       </span>info.m_OverrideWithName = subclass;<span class="Apple-tab-span" style="white-space:pre"> </span></div><div><span class="Apple-tab-span" style="white-space:pre">     </span>info.m_EnabledFlag<span class="Apple-tab-span" style="white-space:pre">          </span>= enableFlag;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>info.m_CreateObject<span class="Apple-tab-span" style="white-space:pre">         </span>= createFunction;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">   </span>m_OverrideMap->insert(OverRideMap::value_type(classOverride, info));</div><div>}</div></div><div><br></div><div>where <span style="line-height: 1.7;">m_OverrideMap->insert(OverRideMap::value_type(classOverride, info));. it will insert the </span><span style="line-height: 1.7;">classOverride to the </span><span style="line-height: 1.7;">m_OverrideMap not  subclass. I think </span><span style="line-height: 1.7;">classOverride should be the farther class and the </span><span style="line-height: 1.7;">subclass is the class we working.</span></div><div><span style="line-height: 1.7;"><br></span></div><div><span style="line-height: 1.7;">in the </span>ObjectFactoryBase::CreateObject(const char* classname) function there is one </div><div><div>OverRideMap::iterator start = m_OverrideMap->lower_bound(classname);</div><div>OverRideMap::iterator end = m_OverrideMap->upper_bound(classname);</div></div><div>I think the parameter <span style="line-height: 1.7;">classname should be the class we working() the working class).</span></div><div><span style="line-height: 1.7;"><br></span></div><div><span style="line-height: 1.7;">So, I think we need call functions like   </span></div><div><span style="line-height: 1.7;">-></span><span style="line-height: 1.7;">RegisterOverride( ITK::Object, MyObject,....)</span></div><div>->CreateObject("<span style="line-height: 1.7;">MyObject</span><span style="line-height: 1.7;">") </span></div><div><span style="line-height: 1.7;"><br></span></div><div><span style="line-height: 1.7;">In this way </span><span style="line-height: 1.7;">OverRideMap::iterator start = m_OverrideMap->lower_bound(classname) can not get the </span><span style="line-height: 1.7;">MyObject position</span></div><div><span style="line-height: 1.7;"><br></span></div><div>so, <span style="line-height: 1.7;">m_OverrideMap->insert(OverRideMap::value_type(classOverride, info)); should be </span></div><div>m_OverrideMap->insert(OverRideMap::value_type(subclass, info)); ???</div><div><br></div><div>I just have this confusion</div><div>If I explain the problem well?</div><div>thanks</div><div>han</div><div><br></div><div><span style="line-height: 1.7;"><br></span></div><div><span style="line-height: 1.7;"><br></span></div><div><br></div><div><span style="line-height: 1.7;"><br></span></div><div><span style="line-height: 1.7;"><br></span></div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>