当前位置: 首页>>代码示例>>C++>>正文


C++ AffineTransform::Compose方法代码示例

本文整理汇总了C++中AffineTransform::Compose方法的典型用法代码示例。如果您正苦于以下问题:C++ AffineTransform::Compose方法的具体用法?C++ AffineTransform::Compose怎么用?C++ AffineTransform::Compose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AffineTransform的用法示例。


在下文中一共展示了AffineTransform::Compose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main


//.........这里部分代码省略.........
		}
		else {
			std::cerr << "The aren't any images to perform subtraction" << std::endl; 
			return EXIT_FAILURE;
		}
	}

    std::cout << "\t/-- Image resampling" << std::endl;
	std::cout << "\t -- WM mask" << std::endl;
	MaskImage baselineWMMaskMoved = BrainRegistration::ResampleImage<AffineTransformType>(followupWMMask, baselineWMMask, affine);
	ProbabilityImage pdMoved;
	if ((pdFollowup != (ProbabilityImage)NULL) && (pdBaseline != (ProbabilityImage)NULL)) {
		pdMoved = BrainRegistration::ResampleImage<AffineTransformType>(pdFollowup, pdBaseline, affine);
		brainio->WriteProbabilityImage(
			followupImagesFolderName + "pd_moved.nii.gz",
			pdMoved
		);
	}
	std::cout << "\t -- T2" << std::endl;
	ProbabilityImage t2Moved;
	if (t2Baseline != (ProbabilityImage)NULL) {
		t2Moved = BrainRegistration::ResampleImage<AffineTransformType>(pdFollowup, t2Baseline, affine);
		brainio->WriteProbabilityImage(
			followupImagesFolderName + "t2_moved.nii.gz",
			t2Moved
		);
	}
	std::cout << "\t -- FLAIR" << std::endl;
	ProbabilityImage flairMoved;
	if (flairBaseline != (ProbabilityImage)NULL) {
		if ((pdBaseline != (ProbabilityImage)NULL) && (pdFollowup != (ProbabilityImage)NULL)) {
            std::cout << "\t   /-- PD in baseline and followup" << std::endl;
			AffineTransform flairAffine = AffineTransformType::New();
			affine->Compose(flairBaselineAffine, true);
			flairMoved = BrainRegistration::ResampleImage<AffineTransformType>(pdFollowup, flairBaseline, affine);
			brainio->WriteProbabilityImage(
				followupImagesFolderName + "flair_moved.nii.gz",
				flairMoved
			);
		}
		else if (pdFollowup != (ProbabilityImage)NULL) {
            std::cout << "\t   /-- PD only in followup" << std::endl;
			flairMoved = BrainRegistration::ResampleImage<AffineTransformType>(pdFollowup, flairBaseline, affine);
			brainio->WriteProbabilityImage(
				followupImagesFolderName + "flair_moved.nii.gz",
				flairMoved
			);
		}
		else {
            std::cout << "\t   /-- No PD" << std::endl;
			flairMoved = BrainRegistration::ResampleImage<AffineTransformType>(flairFollowup, flairBaseline, affine);
			brainio->WriteProbabilityImage(
				followupImagesFolderName + "flair_moved.nii.gz",
				flairMoved
			);
		}
	}

	// Final ROI
	MaskImage wmMask = BrainSegmentation::Union(baselineWMMaskMoved, followupWMMask);
	brainio->WriteMaskImage(
        followupSegmentationFolderName + "union_wm_mask.nii.gz",
		wmMask
	);

	// The last step is to apply the subtraction
开发者ID:NIC-VICOROB,项目名称:braintools,代码行数:67,代码来源:submain.cpp


注:本文中的AffineTransform::Compose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。