Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/osirixplugins/code@397 bdd3870d-6ba2-4b59-8605-1de7af000970
  • Loading branch information
aglv committed Jan 21, 2013
1 parent 712336e commit de6d03c
Show file tree
Hide file tree
Showing 17 changed files with 70 additions and 62 deletions.
18 changes: 3 additions & 15 deletions Ejection Fraction/Ejection Fraction II.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
5969FC1E11184417006C9938 /* Hemi-ellipse-Preview.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = "Hemi-ellipse-Preview.pdf"; path = "Resources/Previews/Hemi-ellipse-Preview.pdf"; sourceTree = "<group>"; };
596DF1F810B59936006351CD /* EjectionFractionWorkflow+OsiriX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "EjectionFractionWorkflow+OsiriX.h"; path = "Sources/EjectionFractionWorkflow+OsiriX.h"; sourceTree = "<group>"; };
596DF1F910B59936006351CD /* EjectionFractionWorkflow+OsiriX.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "EjectionFractionWorkflow+OsiriX.mm"; path = "Sources/EjectionFractionWorkflow+OsiriX.mm"; sourceTree = "<group>"; };
597F141311A40C0F003E22B1 /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = ../../osirix/osirix/build/Development/OsiriXAPI.framework; sourceTree = SOURCE_ROOT; };
597F141311A40C0F003E22B1 /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = "../../osirix-trunk/build/Development/OsiriXAPI.framework"; sourceTree = SOURCE_ROOT; };
5986F7B310DBAFEA00D28EFB /* EjectionFractionDicomSaveDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EjectionFractionDicomSaveDialog.h; path = Sources/EjectionFractionDicomSaveDialog.h; sourceTree = "<group>"; };
5986F7B410DBAFEA00D28EFB /* EjectionFractionDicomSaveDialog.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = EjectionFractionDicomSaveDialog.mm; path = Sources/EjectionFractionDicomSaveDialog.mm; sourceTree = "<group>"; };
5987F5D2103018A5006D39F5 /* Ejection_Fraction_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Ejection_Fraction_Prefix.pch; path = Sources/Ejection_Fraction_Prefix.pch; sourceTree = "<group>"; };
Expand Down Expand Up @@ -334,18 +334,7 @@
DEBUGGING_SYMBOLS = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_3)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_4)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_5)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_6)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_7)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_8)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_9)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_10)",
"\"$(SRCROOT)/../../osirix/osirix/build/Development\"",
"\"$(SRCROOT)/../../osirix-trunk/build/Development/\"",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
Expand All @@ -362,7 +351,6 @@
INSTALL_PATH = "@executable_path/../Plug-ins";
LIBRARY_SEARCH_PATHS = "";
LIBRARY_STYLE = Bundle;
MACOSX_DEPLOYMENT_TARGET = 10.5;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = (
"-undefined",
Expand Down Expand Up @@ -391,7 +379,7 @@
ppc64,
x86_64,
);
MACOSX_DEPLOYMENT_TARGET = 10.5;
MACOSX_DEPLOYMENT_TARGET = 10.7;
SDKROOT = macosx10.7;
};
name = Development;
Expand Down
6 changes: 2 additions & 4 deletions Ejection Fraction/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
<string>BNDL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.5</string>
<key>NSPrincipalClass</key>
<string>EjectionFractionPlugin</string>
<key>MenuTitles</key>
Expand All @@ -29,9 +27,9 @@
<key>CFBundleName</key>
<string>Ejection Fraction II</string>
<key>CFBundleShortVersionString</key>
<string>2.5</string>
<string>2.5.1</string>
<key>NSHumanReadableCopyright</key>
<string>© 2009-2010 OsiriX Team</string>
<string>© 2009-2012 OsiriX Team</string>
<key>CFBundleIdentifier</key>
<string>com.osirix.ejectionfraction</string>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#import <OsiriXAPI/DCMView.h>
#import "EjectionFractionPlugin.h"
#import <algorithm>
#include <math.h>

NSString* DiasLength = @"Diastole length";
NSString* SystLength = @"Systole length";
Expand Down Expand Up @@ -104,7 +105,7 @@ -(CGFloat)ejectionFractionWithDiastoleVolume:(CGFloat)diasVol systoleVolume:(CGF

-(CGFloat)roiArea:(ROI*)roi { // if roi is tMesure return area of circle with diameter [roi length]
if ([roi type] == tMesure)
return pi*std::pow([roi MesureLength:NULL]/2, 2);
return pi*pow([roi MesureLength:NULL]/2, 2);
return [roi roiArea];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>


@interface EjectionFractionDicomSaveDialog : NSWindow {
@interface EjectionFractionDicomSaveDialog : NSWindow<NSWindowDelegate> {
IBOutlet NSColorWell* _imageBackgroundColor;
IBOutlet NSButton* _saveButton;
IBOutlet NSButton* _cancelButton;
Expand Down
2 changes: 1 addition & 1 deletion Ejection Fraction/Sources/EjectionFractionImageView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ -(NSRect)optimalRoiRect {
NSRect space = NSMakeRect(x.min, y.min, x.max-x.min, y.max-y.min);

NSRect contentRect;
contentRect.size = NSMakeSize(std::max(space.size.width, space.size.height));
contentRect.size = NSMakeSize(MAX(space.size.width, space.size.height));
contentRect.origin = space.origin - (contentRect.size-space.size)/2;

contentRect = NSInsetRect(contentRect, -contentRect.size.width/100, -contentRect.size.height/100);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@class EjectionFractionWorkflow, EjectionFractionDicomSaveDialog;

@interface EjectionFractionResultsController : NSWindowController {
@interface EjectionFractionResultsController : NSWindowController<NSWindowDelegate> {
IBOutlet NSView* _dicomSaveOptions;
IBOutlet NSColorWell* _dicomSaveOptionsBackgroundColor;
IBOutlet EjectionFractionDicomSaveDialog* _dicomSaveDialog;
Expand Down
15 changes: 8 additions & 7 deletions Ejection Fraction/Sources/EjectionFractionResultsController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@
#import <OsiriXAPI/DCMPix.h>
#import <OsiriXAPI/DICOMExport.h>
#import <OsiriXAPI/BrowserController.h>
#import <OsiriXAPI/DicomImage.h>
#import "EjectionFractionZoomView.h"

const NSString* FileTypePDF = @"pdf";
const NSString* FileTypeTIFF = @"tiff";
const NSString* FileTypeDICOM = @"dcm";
NSString* const FileTypePDF = @"pdf";
NSString* const FileTypeTIFF = @"tiff";
NSString* const FileTypeDICOM = @"dcm";

@interface EjectionFractionResultsController (Private)

Expand Down Expand Up @@ -198,15 +199,15 @@ -(id)initWithWorkflow:(EjectionFractionWorkflow*)workflow {
if (frame.size.width > screen.size.width || frame.size.height >= screen.size.height) {
if (frame.size.width > screen.size.width)
frame.size.width = screen.size.width;
NSUInteger step = std::max(NSUInteger(frame.size.width/10), NSUInteger(1));
NSUInteger step = MAX(NSUInteger(frame.size.width/10), NSUInteger(1));
frame.size.width += step;
do { // decrease window width until its height fits in the screen
frame.size.width -= step;
NSSize optimalSize = [contentLayout optimalSizeForWidth:[window contentSizeForFrameSize:frame.size].width];
frame.size = [window frameSizeForContentSize:optimalSize];
if (frame.size.height <= screen.size.height && step > 1) {
frame.size.width += step;
step = std::max(step/10, NSUInteger(1));
step = MAX(step/10, NSUInteger(1));
frame.size.height = screen.size.height+1;
}
} while (frame.size.height > screen.size.height && frame.size.width > 20);
Expand Down Expand Up @@ -267,9 +268,9 @@ -(void)dicomSave:(NSString*)seriesDescription backgroundColor:(NSColor*)backgrou

// convert RGBA to RGB - alpha values are considered when mixing the background color with the actual pixel color
NSMutableData* bitmapRGBData = [NSMutableData dataWithCapacity: [bitmapImageRep size].width*[bitmapImageRep size].height*3];
for (int y = 0; y < [bitmapImageRep size].height; ++y) {
for (int y = 0; y < [bitmapImageRep pixelsHigh]; ++y) {
unsigned char* rowStart = [bitmapImageRep bitmapData]+[bitmapImageRep bytesPerRow]*y;
for (int x = 0; x < [bitmapImageRep size].width; ++x) {
for (int x = 0; x < [bitmapImageRep pixelsWide]; ++x) {
unsigned char rgba[4]; memcpy(rgba, rowStart+bytesPerPixel*x, 4);
float ratio = float(rgba[3])/255;
// rgba[0], [1] and [2] are premultiplied by [3]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

@class N2Steps, N2Step, EjectionFractionWorkflow, ROI, N2View, N2Resizer, N2StepsView, N2ColorWell;

@interface EjectionFractionStepsController : NSWindowController {
@interface EjectionFractionStepsController : NSWindowController<NSWindowDelegate> {
EjectionFractionWorkflow* _workflow;

IBOutlet N2Steps* _steps;
Expand Down
2 changes: 2 additions & 0 deletions Ejection Fraction/Sources/EjectionFractionWorkflow+OsiriX.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ enum EjectionFractionROIType {

@interface EjectionFractionWorkflow (OsiriX)

@property(retain) NSString* expectedRoiId;

+(NSArray*)roiTypesForType:(EjectionFractionROIType)roiType;
-(void)initOsiriX;
-(void)deallocOsiriX;
Expand Down
4 changes: 4 additions & 0 deletions Ejection Fraction/Sources/EjectionFractionWorkflow+OsiriX.mm
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ -(void)setExpectedRoiId:(NSString*)roiId {
[[NSNotificationCenter defaultCenter] postNotificationName:EjectionFractionWorkflowExpectedROIChangedNotification object:self];
}

- (NSString*)expectedRoiId {
return _expectedRoiId;
}

-(short)pixIndexForRoi:(ROI*)roi {
// DCMPix* pix = [roi pix];
NSArray* dcmRoiList = [[roi curView] dcmRoiList];
Expand Down
1 change: 0 additions & 1 deletion Ejection Fraction/Sources/EjectionFractionWorkflow.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ extern NSString* Syst;
//@property(assign) ViewerController* viewer;
@property(retain) EjectionFractionStepsController* steps;
@property(retain) EjectionFractionAlgorithm* algorithm;
@property(retain) NSString* expectedRoiId;
@property(retain) NSColor* diasColor;
@property(retain) NSColor* systColor;
@property(readonly) NSDictionary* rois;
Expand Down
10 changes: 3 additions & 7 deletions Ejection Fraction/Sources/EjectionFractionWorkflow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
NSString* Syst = @"Systole";

@implementation EjectionFractionWorkflow
@synthesize plugin = _plugin, /*viewer = _viewer,*/ steps = _steps, algorithm = _algorithm, expectedRoiId = _expectedRoiId;
@synthesize plugin = _plugin, /*viewer = _viewer,*/ steps = _steps, algorithm = _algorithm;

-(id)initWithPlugin:(EjectionFractionPlugin*)plugin viewer:(ViewerController*)viewer {
self = [super init];
Expand All @@ -37,10 +37,6 @@ -(id)retain {
return [super retain];
}

-(void)release {
[super release];
}

-(void)dealloc {
DLog(@"%X [EjectionFractionWorkflow dealloc]", self);
[self deallocOsiriX];
Expand Down Expand Up @@ -69,8 +65,8 @@ -(NSDictionary*)rois {

static NSColor* DiasColor = NULL;
static NSColor* SystColor = NULL;
const static NSString* const DiasColorUserDefaultsKey = @"EjectionFractionDiastoleColor";
const static NSString* const SystColorUserDefaultsKey = @"EjectionFractionSystoleColor";
static NSString* const DiasColorUserDefaultsKey = @"EjectionFractionDiastoleColor";
static NSString* const SystColorUserDefaultsKey = @"EjectionFractionSystoleColor";

-(NSColor*)diasColor {
if (!DiasColor)
Expand Down
2 changes: 1 addition & 1 deletion Worklists/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0.2</string>
<string>1.0.3</string>
<key>NSPrincipalClass</key>
<string>WorklistsPlugin</string>
<key>pluginType</key>
Expand Down
39 changes: 23 additions & 16 deletions Worklists/Resources/WorklistsPreferences.xib
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
<string key="NSFrameSize">{119, 332}</string>
<reference key="NSSuperview" ref="138681545"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="459641479"/>
<reference key="NSNextKeyView" ref="153232773"/>
<string key="NSReuseIdentifierKey">_NS:13</string>
<bool key="NSEnabled">YES</bool>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
Expand Down Expand Up @@ -284,7 +284,7 @@
<string key="NSFrame">{{20, 73}, {120, 334}}</string>
<reference key="NSSuperview" ref="1006771505"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="153232773"/>
<reference key="NSNextKeyView" ref="138681545"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<int key="NSsFlags">133778</int>
<reference key="NSVScroller" ref="459641479"/>
Expand Down Expand Up @@ -564,7 +564,6 @@
<string key="NSFrame">{{232, 17}, {314, 19}}</string>
<reference key="NSSuperview" ref="1006771505"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="690725801">
Expand Down Expand Up @@ -1484,7 +1483,7 @@
<string key="NSFrame">{{356, 4}, {18, 18}}</string>
<reference key="NSSuperview" ref="618447804"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="325976962"/>
<reference key="NSNextKeyView" ref="434754369"/>
<int key="NSTag">-1</int>
<bool key="NSEnabled">YES</bool>
<object class="NSRuleEditorButtonCell" key="NSCell">
Expand Down Expand Up @@ -2020,7 +2019,7 @@
<string key="NSFrame">{{160, 53}, {386, 76}}</string>
<reference key="NSSuperview" ref="1006771505"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="847112144"/>
<reference key="NSNextKeyView" ref="11205539"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<int key="NSsFlags">133650</int>
<reference key="NSVScroller" ref="325976962"/>
Expand Down Expand Up @@ -2987,9 +2986,9 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<object class="IBOutletConnection" key="connection">
<string key="label">nextKeyView</string>
<reference key="source" ref="249546004"/>
<reference key="destination" ref="1046230431"/>
<reference key="destination" ref="313400854"/>
</object>
<int key="connectionID">1347</int>
<int key="connectionID">1412</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
Expand Down Expand Up @@ -3019,9 +3018,9 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<object class="IBOutletConnection" key="connection">
<string key="label">nextKeyView</string>
<reference key="source" ref="321639974"/>
<reference key="destination" ref="765577415"/>
<reference key="destination" ref="454420720"/>
</object>
<int key="connectionID">1311</int>
<int key="connectionID">1414</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
Expand Down Expand Up @@ -3203,10 +3202,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">nextKeyView</string>
<reference key="source" ref="117163825"/>
<reference key="destination" ref="722339517"/>
<reference key="source" ref="313400854"/>
<reference key="destination" ref="1046230431"/>
</object>
<int key="connectionID">1398</int>
<int key="connectionID">1413</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
Expand Down Expand Up @@ -3240,10 +3239,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">nextKeyView</string>
<reference key="source" ref="454420720"/>
<reference key="destination" ref="434754369"/>
<reference key="source" ref="117163825"/>
<reference key="destination" ref="765577415"/>
</object>
<int key="connectionID">1406</int>
<int key="connectionID">1416</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
Expand All @@ -3261,6 +3260,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<int key="connectionID">1410</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">nextKeyView</string>
<reference key="source" ref="454420720"/>
<reference key="destination" ref="117163825"/>
</object>
<int key="connectionID">1415</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
Expand Down Expand Up @@ -4437,7 +4444,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">1411</int>
<int key="maxID">1416</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand Down
Loading

0 comments on commit de6d03c

Please sign in to comment.