X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FcreaImageIOWxGimmick.cpp;h=4b8f3f3f76dbc77d6716617baa36dc5224249b51;hb=b029354f54449e058d14c671e7155e65b4086de6;hp=3ad5e81280ede7cdd930ffcaab3ae209e648a723;hpb=26963d13f31f98807176a062b1d2c209df9c7869;p=creaImageIO.git diff --git a/src/creaImageIOWxGimmick.cpp b/src/creaImageIOWxGimmick.cpp index 3ad5e81..4b8f3f3 100644 --- a/src/creaImageIOWxGimmick.cpp +++ b/src/creaImageIOWxGimmick.cpp @@ -63,6 +63,8 @@ namespace creaImageIO PopUp_Settings = 501, PopUp_About = 502, PopUp_User = WxGimmick::UserMenuFirstId, + PopUp_SaveAs = 701, + PopUp_AddToFavorites = 702 }; //================================================================ @@ -931,11 +933,13 @@ namespace creaImageIO { wxBusyCursor busy; // std::cout << "WxGimmick : Reading config"< Loading collections from '"<GetNextSibling(sib); } - prio = maxprio + 1000; + prio = maxprio + 999; sib = GetTreeListCtrl()->GetPrevSibling(item); while (sib.IsOk()) { @@ -2035,13 +2046,17 @@ namespace creaImageIO void WxGimmick::ShowImage(vtkImageData* im) { // wxBusyCursor busy; + mViewer->SetInput( im ); + mViewer->SetSlice( 0 ); + int x1,x2,y1,y2,z1,z2; double spx,spy,spz; + im->Update(); im->GetSpacing(spx,spy,spz); im->GetExtent (x1,x2,y1,y2,z1,z2); - /* + std::cout << "-----------------------------"<GetScalarRange(); + mViewer->SetColorWindow(range[1] - range[0]); + mViewer->SetColorLevel(0.5 * (range[1] + range[0])); + + mViewer->GetRenderer()->ResetCamera(); + double bounds[6]; + + + mViewer->GetRenderer()->ComputeVisiblePropBounds(bounds); + + /* + std::cout <<"bounds : "<GetRenderer()->ResetCameraClippingRange(bounds); + /* vtkCamera *camera = mViewer->GetRenderer()->GetActiveCamera(); camera->SetViewUp ( spx*0, -spy*1, spz*0); - camera->SetPosition( spx*(x1+x2)/2, spy*(y1+y2)/2, -spz*10000000); + camera->SetPosition( spx*(x1+x2)/2, spy*(y1+y2)/2, spz*10000000); camera->SetFocalPoint ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*0); camera->ComputeViewPlaneNormal(); camera->SetParallelScale( spx*(x2-x1)/2.0 ); + camera->Roll ( 180 ); + */ } - mViewer->SetInput( im ); - mViewer->SetSlice( 0 ); mInteractor->Render(); } //================================================================ @@ -2270,6 +2305,10 @@ namespace creaImageIO ext[5] = im.size(); out->SetExtent(ext); // LG : TODO : Z Spacing ? + // + // ==> to get an accurate ZSpacing from a Dicom set of files + // ==> you need a gdcm::SerieHelper + // JPR out->AllocateScalars();