| 1759 | } |
| 1760 | |
| 1761 | int vtkGenerateStatistics::ComputeDerivedData(vtkPartitionedDataSetCollection* model) |
| 1762 | { |
| 1763 | // Iterate over the statistical models in the PDC and add derived |
| 1764 | // statistics to them. |
| 1765 | int numPDs = model->GetNumberOfPartitionedDataSets(); |
| 1766 | for (int ii = 0; ii < numPDs; ++ii) |
| 1767 | { |
| 1768 | auto* pds = model->GetPartitionedDataSet(ii); |
| 1769 | for (unsigned int jj = 0; jj < pds->GetNumberOfPartitions(); ++jj) |
| 1770 | { |
| 1771 | if (auto* stats = vtkStatisticalModel::SafeDownCast(pds->GetPartitionAsDataObject(jj))) |
| 1772 | { |
| 1773 | // Configure this->StatisticsAlgorithm for Learn mode |
| 1774 | // and run this->StatisticsAlgorithm |
| 1775 | this->StatisticsAlgorithm->SetInputDataObject(vtkStatisticsAlgorithm::INPUT_MODEL, stats); |
| 1776 | this->StatisticsAlgorithm->SetLearnOption(false); |
| 1777 | this->StatisticsAlgorithm->SetDeriveOption(true); |
| 1778 | this->StatisticsAlgorithm->SetAssessOption(false); |
| 1779 | this->StatisticsAlgorithm->SetTestOption(false); |
| 1780 | this->StatisticsAlgorithm->Update(); |
| 1781 | |
| 1782 | // Copy or merge the model output into the given PDC |
| 1783 | // TODO: Do this better (match structure, look at SingleModel ivar) |
| 1784 | stats->ShallowCopy( |
| 1785 | this->StatisticsAlgorithm->GetOutputDataObject(vtkStatisticsAlgorithm::OUTPUT_MODEL)); |
| 1786 | } |
| 1787 | } |
| 1788 | } |
| 1789 | return 1; |
| 1790 | } |
| 1791 | |
| 1792 | VTK_ABI_NAMESPACE_END |
no test coverage detected