21 std::cout <<
"Loading file: ";
24 std::cout <<
"no file specified [FAILED]" << std::endl;
31 image = mitk::IOUtil::Load<mitk::Image>(argv[1]);
35 std::cout <<
"file not an image - test will not be applied [PASSED]" << std::endl;
36 std::cout <<
"[TEST DONE]" << std::endl;
39 catch (
const itk::ExceptionObject &ex )
41 std::cout <<
"Exception: " << ex.GetDescription() <<
"[FAILED]" << std::endl;
45 if (image->GetDimension(2) < 2)
50 slice->SetInput(image);
51 slice->SetSliceNr(slice_nr);
54 std::cout <<
"Testing IsInitialized(): ";
55 if (slice->GetOutput()->IsInitialized() ==
false)
57 std::cout <<
"[FAILED]" << std::endl;
60 std::cout <<
"[PASSED]" << std::endl;
62 std::cout <<
"Testing IsSliceSet(): ";
63 if (slice->GetOutput()->IsSliceSet(0) ==
false)
65 std::cout <<
"[FAILED]" << std::endl;
68 std::cout <<
"[PASSED]" << std::endl;
141 slice->UpdateLargestPossibleRegion();
143 catch (
const itk::ExceptionObject &)
145 std::cout <<
"Part 2 [FAILED]" << std::endl;
148 std::cout <<
"Part 2 [PASSED]" << std::endl;
150 std::cout <<
"Testing IsInitialized(): ";
151 if (slice->GetOutput()->IsInitialized() ==
false)
153 std::cout <<
"[FAILED]" << std::endl;
156 std::cout <<
"[PASSED]" << std::endl;
158 std::cout <<
"Testing IsSliceSet(): ";
159 if (slice->GetOutput()->IsSliceSet(0) ==
false)
161 std::cout <<
"[FAILED]" << std::endl;
164 std::cout <<
"[PASSED]" << std::endl;
166 if (image->GetDimension(3) > 1)
168 int time = image->GetDimension(3) - 1;
170 std::cout <<
"Testing 3D+t: Setting time to " << time <<
": ";
171 slice->SetTimeNr(time);
172 if (slice->GetTimeNr() != time)
174 std::cout <<
"[FAILED]" << std::endl;
177 std::cout <<
"[PASSED]" << std::endl;
179 std::cout <<
"Testing 3D+t: Updating slice: ";
181 if (slice->GetOutput()->IsInitialized() ==
false)
183 std::cout <<
"[FAILED]" << std::endl;
186 std::cout <<
"[PASSED]" << std::endl;
188 std::cout <<
"Testing 3D+t: IsSliceSet(): ";
189 if (slice->GetOutput()->IsSliceSet(0) ==
false)
191 std::cout <<
"[FAILED]" << std::endl;
194 std::cout <<
"[PASSED]" << std::endl;
196 std::cout <<
"Testing 3D+t: First slice in reader available: ";
197 if (image->IsSliceSet(0, time) ==
false)
199 std::cout <<
"[FAILED]" << std::endl;
202 std::cout <<
"[PASSED]" << std::endl;
205 std::cout <<
"[TEST DONE]" << std::endl;
int mitkImageSliceSelectorTest(int argc, char *argv[])
An object of this class represents an exception of MITK. Please don't instantiate exceptions manually...
mitk::Image::Pointer image