comparison Framework/dev.h @ 120:063f7f3d9f14 wasm

fix 3d locations of the doses
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 04 Oct 2017 15:51:34 +0200
parents ba83e38cf3ff
children e66b2c757790
comparison
equal deleted inserted replaced
119:ba83e38cf3ff 120:063f7f3d9f14
131 { 131 {
132 // This is a volume with one single slice: Choose a dummy 132 // This is a volume with one single slice: Choose a dummy
133 // z-dimension for voxels 133 // z-dimension for voxels
134 spacingZ = 1; 134 spacingZ = 1;
135 } 135 }
136 136
137 for (size_t i = 1; i < loader.GetSliceCount(); i++) 137 for (size_t i = 1; i < loader.GetSliceCount(); i++)
138 { 138 {
139 if (!GeometryToolbox::IsNear(spacingZ, GetDistance(loader.GetSlice(i - 1), loader.GetSlice(i)), 139 if (!GeometryToolbox::IsNear(spacingZ, GetDistance(loader.GetSlice(i - 1), loader.GetSlice(i)),
140 0.001 /* this is expressed in mm */)) 140 0.001 /* this is expressed in mm */))
141 { 141 {
154 image_.reset(new ImageBuffer3D(format, width, height, loader.GetSliceCount(), computeRange_)); 154 image_.reset(new ImageBuffer3D(format, width, height, loader.GetSliceCount(), computeRange_));
155 image_->SetAxialGeometry(loader.GetSlice(0).GetGeometry()); 155 image_->SetAxialGeometry(loader.GetSlice(0).GetGeometry());
156 image_->SetVoxelDimensions(loader.GetSlice(0).GetPixelSpacingX(), 156 image_->SetVoxelDimensions(loader.GetSlice(0).GetPixelSpacingX(),
157 loader.GetSlice(0).GetPixelSpacingY(), spacingZ); 157 loader.GetSlice(0).GetPixelSpacingY(), spacingZ);
158 image_->Clear(); 158 image_->Clear();
159 159
160 downloadStack_.reset(new DownloadStack(loader.GetSliceCount())); 160 downloadStack_.reset(new DownloadStack(loader.GetSliceCount()));
161 161
162 for (unsigned int i = 0; i < 4; i++) // Limit to 4 simultaneous downloads 162 for (unsigned int i = 0; i < 4; i++) // Limit to 4 simultaneous downloads
163 { 163 {
164 ScheduleSliceDownload(); 164 ScheduleSliceDownload();
389 break; 389 break;
390 390
391 default: 391 default:
392 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); 392 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
393 } 393 }
394
395 //sliceThickness_ = 3.0f; // TODO XXXXX
396 } 394 }
397 395
398 size_t GetSliceCount() const 396 size_t GetSliceCount() const
399 { 397 {
400 return depth_; 398 return depth_;
643 virtual void NotifyGeometryReady(const ISlicedVolume& volume) 641 virtual void NotifyGeometryReady(const ISlicedVolume& volume)
644 { 642 {
645 if (slices_.get() == NULL) 643 if (slices_.get() == NULL)
646 { 644 {
647 const OrthancVolumeImage& image = dynamic_cast<const OrthancVolumeImage&>(volume); 645 const OrthancVolumeImage& image = dynamic_cast<const OrthancVolumeImage&>(volume);
648 646
649 slices_.reset(new VolumeImageGeometry(image, projection_)); 647 slices_.reset(new VolumeImageGeometry(image, projection_));
650 SetSlice(slices_->GetSliceCount() / 2); 648 SetSlice(slices_->GetSliceCount() / 2);
651 649
652 widget_.SetDefaultView(); 650 widget_.SetDefaultView();
653 } 651 }
654 } 652 }
655 653
656 virtual void NotifyGeometryError(const ISlicedVolume& volume) 654 virtual void NotifyGeometryError(const ISlicedVolume& volume)