本文整理汇总了C++中volmagick::Volume::gdtvFilter方法的典型用法代码示例。如果您正苦于以下问题:C++ Volume::gdtvFilter方法的具体用法?C++ Volume::gdtvFilter怎么用?C++ Volume::gdtvFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类volmagick::Volume
的用法示例。
在下文中一共展示了Volume::gdtvFilter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
void operator()()
{
CVC::ThreadFeedback feedback;
if (_output.empty()) {
_output = _volSelected+"_gdtv";
}
if (_dataset.empty()) {
_dataset = _volSelected+"_gdtv";
}
// read in the data if necessary
if(cvcapp.isData<VolMagick::VolumeFileInfo>(_volSelected))
{
VolMagick::VolumeFileInfo vfi = cvcapp.data<VolMagick::VolumeFileInfo>(_volSelected);
if (_currentIndex == 0) {
if (_output.substr(_output.find_last_of(".")) != _fileType) {
_output = _output + _fileType;
}
VolMagick::createVolumeFile(_output,
vfi.boundingBox(),
vfi.dimension(),
vfi.voxelTypes(),
vfi.numVariables(),
vfi.numTimesteps(),
vfi.TMin(),
vfi.TMax());
}
// run gdtv filter
for(unsigned int var=0; var<vfi.numVariables(); var++) {
for(unsigned int time=0; time<vfi.numTimesteps(); time++) {
VolMagick::Volume vol;
readVolumeFile(vol,vfi.filename(),var,time);
vol.gdtvFilter(2.0-_exp,_lambda,_iterations,_nhood-1.0);
if (_currentIndex == 0) {
writeVolumeFile(vol,_output,var,time);
} else if (_currentIndex == 1) {
// put the dataset in the list
cvcapp.data(_dataset,vol);
}
}
}
}
else if(cvcapp.isData<VolMagick::Volume>(_volSelected))
{
VolMagick::Volume vol = cvcapp.data<VolMagick::Volume>(_volSelected);
vol.gdtvFilter(2.0-_exp,_lambda,_iterations,_nhood-1.0);
if (_currentIndex == 0) {
//if _output not set, overwrite the input volume data
if(_output.empty())
cvcapp.data(_volSelected, vol);
else {
_output = _output + _fileType;
cvcapp.data(_output, vol);
}
} else if (_currentIndex == 1) {
cvcapp.data(_dataset,vol);
}
}
}