<html>
Hello Jim,<br><br>
Considering how close you are to Bill, I can't even believe you would
suggest option 3 (deprecation)! :-)<br><br>
Your middle option would also have a serious impact on developers since
it is common to specify the important parameters directly in the
vtkImageData (such as scalar type and number of components) then call
this->AllocateScalars(). Unless this sequence of events still works as
before, this would not be a good option.<br><br>
Although the second two options are probably cleaner, I would have to
vote for the first to reduce the impact on developers.<br><br>
Lisa<br><br>
<br>
At 11:41 AM 9/27/2002, Miller, James V (Research) wrote:<br>
<blockquote type=cite class=cite cite><font size=2>There seems to be a
problem with vtkAssignAttribute operating on ImageData.</font><br>
<br>
<font size=2>We were using vtkAssignAttribute to take the vectors of a
dataset and use them as multi-component scalars.</font><br>
<font size=2>When the dataset is an ImageData, the output of the
vtkAssignAttribute filter does not adjust the </font><br>
<font size=2>NumberOfScalarComponents of the ImageData.</font><br>
<br>
<font size=2>These problem arises because ImageData caches the
NumberOfScalarComponents from the scalars</font><br>
<font size=2>array. When the number of components in the scalars
are changed, the ImageData needs to be told.</font><br>
<font size=2>vtkAssignAttributes works generically on DataSets so it
doesn't know its operating on an ImageData</font><br>
<font size=2>and thus doesn't tell the ImageData that new number of
scalar components.</font><br>
<br>
<font size=2>If a filter after the vtkAssignAttribute in the pipeline
querys the ImageData::GetNumberOfScalarComponents()</font><br>
<font size=2>instead of
ImageData::GetScalars()->GetNumberOfScalarsComponents() then it will
not operate properly.</font><br>
<br>
<font size=2>Possible solutions:</font>
<ol><font size=2>
<li>vtkAssignAttributes could check whether it is operating on ImageData
and whether the scalars are being modified and the adjust the
NumberOfScalarComponents on the ImageData appropriately. This is not too
bad an option if ImageData is the only dataset type that caches this
information.</font> <font size=2>
<li>Change
ImageData::GetNumberOfScalarComponents()/SetNumberOfScalarComponents() to
delegate these calls to the scalars DataArray instead of caching the
values. This could impact how people are constructing ImageData
(where they would set the NumberOfScalarComponents on an ImageData, then
have the allocate procedures create a scalars DataArray with the proper
number of components.</font> <font size=2>
<li>Deprecate
ImageData::GetNumerOfScalarComponents()/GetNumberOfScalarComponents()</font>
</ol> <br>
<?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" /><br><br>
<b>Jim Miller</b> <br>
<b><i>_____________________________________</i></b><br>
<i>Visualization & Computer Vision<br>
GE Research</i><br>
<i>Bldg. KW, Room C218B</i><br>
<i>P.O. Box 8, Schenectady NY 12301</i><br><br>
<i><u><a href="mailto:millerjv@research.ge.com">millerjv@research.ge.com</a><br>
</u></i><br>
<i><u>james.miller@research.ge.com</u></i><br>
<i>(518) 387-4005, Dial Comm: 8*833-4005, </i><br>
<i>Cell: (518) 505-7065, Fax: (518) 387-6981</i> <br><br>
<br>
</blockquote></html>