Skip to content

Commit

Permalink
Merge branch 'develop' of http://github.com/pixmeo/osirixplugins into…
Browse files Browse the repository at this point in the history
… develop

Conflicts:
	DicomUnEnhancer/.DS_Store
  • Loading branch information
b-deville committed Sep 16, 2013
2 parents fff8eb9 + 34cc2c1 commit 0adea4a
Show file tree
Hide file tree
Showing 16 changed files with 2,463 additions and 1,175 deletions.
15 changes: 5 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@

.DS_Store
*.DS_Store

ASOC/ASOC.xcodeproj/project.xcworkspace/xcuserdata/jacquesfauquex.xcuserdatad/UserInterfaceState.xcuserstate
__MACOSX/

ASOC/ASOC.xcodeproj/project.xcworkspace/xcuserdata/jacquesfauquex.xcuserdatad/WorkspaceSettings.xcsettings
*.xcworkspacedata

ASOC/ASOC.xcodeproj/xcuserdata/jacquesfauquex.xcuserdatad/xcschemes/ASOC.xcscheme
*.xcscheme

ASOC/ASOC.xcodeproj/xcuserdata/jacquesfauquex.xcuserdatad/xcschemes/xcschememanagement.plist
*.xcbkptlist

DiscPublishing/Libs/*

*.xcuserstate

*.xcuserstate

DiscPublishing/DiscPublishing.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate

DiscPublishing/DiscPublishing.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>CMIV_CTA_TOOLS.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>8D5B49AC048680CD000E48DA</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
3,126 changes: 2,120 additions & 1,006 deletions CMIV_CTA_TOOLS/Scissors_Panel.xib

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>DefaultDefaults.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>8D5B49AC048680CD000E48DA</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
Binary file removed DicomUnEnhancer/.DS_Store
Binary file not shown.
7 changes: 5 additions & 2 deletions ExportROIs/ExportROIsPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,11 @@ - (void) endSavePanel: (NSSavePanel *) sheet returnCode: (int) retCode contextIn

[ fname appendString: @".csv" ];
const char *str = [ csvText cStringUsingEncoding: NSASCIIStringEncoding ];
NSData *data = [ NSData dataWithBytes: str length: strlen( str ) ];
[ data writeToFile: fname atomically: YES ];
if (str)
{
NSData *data = [ NSData dataWithBytes: str length: strlen( str ) ];
[ data writeToFile: fname atomically: YES ];
}

} else {

Expand Down
36 changes: 14 additions & 22 deletions HelloWorld/HelloWorld.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objectVersion = 42;
objects = {

/* Begin PBXBuildFile section */
Expand All @@ -12,12 +12,12 @@
592685DF11D2089100CFA81F /* PreferencePanes.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 592685DE11D2089100CFA81F /* PreferencePanes.framework */; };
5926860711D2098C00CFA81F /* HelloWorldPreferences.prefPane in Resources */ = {isa = PBXBuildFile; fileRef = 592685B011D204D100CFA81F /* HelloWorldPreferences.prefPane */; };
59A3C84A130D6A1E001937EB /* fatigue.png in Resources */ = {isa = PBXBuildFile; fileRef = 59A3C849130D6A1E001937EB /* fatigue.png */; };
59A3C9ED130D6BB5001937EB /* OsiriXAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59A3C9EC130D6BB5001937EB /* OsiriXAPI.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
59A3CBB2130D704E001937EB /* HelloWorldFilter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 59A3CBB1130D704E001937EB /* HelloWorldFilter.mm */; };
8D5B49AE048680CD000E48DA /* HelloWorld_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32DBCF630370AF2F00C91783 /* HelloWorld_Prefix.pch */; };
8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; };
8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; };
ABA48A650680BB600089EB4F /* HelloWorldFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = ABA48A640680BB600089EB4F /* HelloWorldFilter.h */; };
CEDF64BA17E208DD009BB3F3 /* OsiriXAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEDF64B917E208DD009BB3F3 /* OsiriXAPI.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -43,11 +43,11 @@
592685C211D2056D00CFA81F /* HelloWorldPreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HelloWorldPreferencesController.m; sourceTree = "<group>"; };
592685DE11D2089100CFA81F /* PreferencePanes.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PreferencePanes.framework; path = /System/Library/Frameworks/PreferencePanes.framework; sourceTree = "<absolute>"; };
59A3C849130D6A1E001937EB /* fatigue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = fatigue.png; sourceTree = "<group>"; };
59A3C9EC130D6BB5001937EB /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = ../../osirix/osirix/build/Development/OsiriXAPI.framework; sourceTree = SOURCE_ROOT; };
59A3CBB1130D704E001937EB /* HelloWorldFilter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HelloWorldFilter.mm; sourceTree = "<group>"; };
8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
AB5D36050680E57E00F4007A /* HelloWorld.osirixplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HelloWorld.osirixplugin; sourceTree = BUILT_PRODUCTS_DIR; };
ABA48A640680BB600089EB4F /* HelloWorldFilter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HelloWorldFilter.h; sourceTree = "<group>"; };
CEDF64B917E208DD009BB3F3 /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OsiriXAPI.framework; path = ../../osirix/build/Development/OsiriXAPI.framework; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -64,7 +64,7 @@
buildActionMask = 2147483647;
files = (
8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */,
59A3C9ED130D6BB5001937EB /* OsiriXAPI.framework in Frameworks */,
CEDF64BA17E208DD009BB3F3 /* OsiriXAPI.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -116,7 +116,7 @@
1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
59A3C9EC130D6BB5001937EB /* OsiriXAPI.framework */,
CEDF64B917E208DD009BB3F3 /* OsiriXAPI.framework */,
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */,
);
name = "Linked Frameworks";
Expand Down Expand Up @@ -396,7 +396,9 @@
"$(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_1 = "\"$(SRCROOT)/../../osirix/build/Development\"";
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SRCROOT)/../../osirix-trunk/build/Development\"";
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
Expand Down Expand Up @@ -439,9 +441,11 @@
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_3)",
);
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../osirix/osirix/build/Development\"";
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SRCROOT)/../../osirix-trunk/build/Development\"";
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_3 = "\"$(SRCROOT)/../../osirix/build/Development\"";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_TRIGRAPHS = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
Expand Down Expand Up @@ -477,9 +481,11 @@
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_3)",
);
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../osirix/osirix/build/Development\"";
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SRCROOT)/../../osirix-trunk/build/Development\"";
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_3 = "\"$(SRCROOT)/../../osirix/build/Development\"";
GCC_ENABLE_TRIGRAPHS = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = HelloWorld_Prefix.pch;
Expand Down Expand Up @@ -509,39 +515,25 @@
CE6A9A9508AC841300D0C1EE /* Development */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
i386,
ppc,
ppc64,
x86_64,
);
GCC_C_LANGUAGE_STANDARD = gnu99;
MACOSX_DEPLOYMENT_TARGET = 10.5;
SDKROOT = macosx10.5;
SDKROOT = macosx10.7;
};
name = Development;
};
CE6A9A9608AC841300D0C1EE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
ppc,
i386,
);
MACOSX_DEPLOYMENT_TARGET = 10.4;
SDKROOT = macosx10.5;
SDKROOT = macosx10.7;
};
name = Deployment;
};
CE6A9A9708AC841300D0C1EE /* Default */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
ppc,
i386,
);
MACOSX_DEPLOYMENT_TARGET = 10.4;
SDKROOT = macosx10.5;
SDKROOT = macosx10.7;
};
name = Default;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>HelloWorld.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>HelloWorldPreferences.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>592685AF11D204D100CFA81F</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>8D5B49AC048680CD000E48DA</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
84 changes: 84 additions & 0 deletions HelloWorld/HelloWorldFilter.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#import "HelloWorldFilter.h"
#import <OsiriXAPI/PreferencesWindowController.h>
#import <OsiriXAPI/N2Operators.h>
#import <OsiriXAPI/SRController.h>

@implementation HelloWorldFilter

Expand All @@ -18,6 +19,9 @@ - (void) initPlugin
// target in this project, named HelloWorldPreferences: as its info.plist file describes, the main
// class of the prefPane bunndle is HelloWorldPreferencesController, while the main nib is HelloWorldPreferences.xib
[PreferencesWindowController addPluginPaneWithResourceNamed:@"HelloWorldPreferences" inBundle:[NSBundle bundleForClass:[self class]] withTitle:@"Hello World" image:[NSImage imageNamed:@"NSUser"]];


[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector( windowDidBecomeMain:) name: NSWindowDidBecomeMainNotification object: nil];
}

- (long) filterImage:(NSString*) menuName
Expand All @@ -38,6 +42,86 @@ - (long) filterImage:(NSString*) menuName
return 0; // No Errors
}

// Add a custom icon
- (NSArray*) toolbarAllowedIdentifiersForViewer: (id) v
{
if( [v isKindOfClass: [ViewerController class]])
{
return [NSArray arrayWithObject: @"MyImageIdentifier"];
}

if( [v isKindOfClass: [SRController class]])
{
return [NSArray arrayWithObject: @"MyImageIdentifier2"];
}

return [NSArray array];
}

//
- (NSToolbarItem *) toolbarItemForItemIdentifier: (NSString *) itemIdent forViewer: (id) v
{
if([itemIdent isEqualToString: @"MyImageIdentifier"] && [v isKindOfClass: [ViewerController class]])
{
NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdent] autorelease];

[toolbarItem setLabel: NSLocalizedString( @"Plugin",nil)];
[toolbarItem setImage: [[[NSImage alloc] initWithContentsOfFile:[[NSBundle bundleForClass:HelloWorldFilter.class] pathForResource:@"fatigue" ofType:@"png"]] autorelease]];

[toolbarItem setTarget: self];
[toolbarItem setAction: @selector(filterImage:)];

return toolbarItem;
}

if([itemIdent isEqualToString: @"MyImageIdentifier2"] && [v isKindOfClass: [SRController class]])
{
NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdent] autorelease];

[toolbarItem setLabel: NSLocalizedString( @"Plugin 2",nil)];
[toolbarItem setImage: [[[NSImage alloc] initWithContentsOfFile:[[NSBundle bundleForClass:HelloWorldFilter.class] pathForResource:@"fatigue" ofType:@"png"]] autorelease]];

return toolbarItem;
}

return nil;
}

- (void) windowDidBecomeMain:(NSNotification *)aNotification
{
NSWindow *w = [aNotification object];

//We will automatically add our toolbar icon, if it's not here

if( [w.windowController isKindOfClass: [ViewerController class]])
{
ViewerController *vc = w.windowController;

NSToolbar *t = [vc toolbar]; // ViewerController toolbar is a SPECIAL case : you CANNOT use window.toolbar, but you HAVE TO use [window.windowcontroller toolbar]

for( NSToolbarItem *i in t.items)
{
if( [i.itemIdentifier isEqualToString: @"MyImageIdentifier"])
return;
}

[t insertItemWithItemIdentifier: @"MyImageIdentifier" atIndex: 0];
}

if( [w.windowController isKindOfClass: [SRController class]])
{
NSToolbar *t = [w toolbar];

for( NSToolbarItem *i in t.items)
{
if( [i.itemIdentifier isEqualToString: @"MyImageIdentifier2"])
return;
}

[t insertItemWithItemIdentifier: @"MyImageIdentifier2" atIndex: 0];
}
}

// This method demonstrate how to loop through all the images of the current viewer
- (void) loopTroughImages;
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
CLANG_ENABLE_OBJC_ARC = NO;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = NO;
COMBINE_HIDPI_IMAGES = YES;
Expand Down Expand Up @@ -389,7 +389,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
CLANG_ENABLE_OBJC_ARC = NO;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = NO;
COMBINE_HIDPI_IMAGES = YES;
Expand All @@ -415,7 +415,7 @@
CE6A9A9108AC841300D0C1EE /* Development */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEBUGGING_SYMBOLS = YES;
Expand Down Expand Up @@ -458,7 +458,7 @@
CE6A9A9208AC841300D0C1EE /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down
Loading

0 comments on commit 0adea4a

Please sign in to comment.