Skip to content

Commit

Permalink
Merge pull request #11 from mslw/new-suffix
Browse files Browse the repository at this point in the history
Enable field maps from AP & PA EPI
  • Loading branch information
mslw authored May 11, 2022
2 parents 75f8b77 + fcc6778 commit a0ee265
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project versioning is based on [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.0.1] - 2022-05-11
### Added
- Enabled blip-up & blip-down fieldmap EPI (dir-AP_epi & dir-PA_epi)
- Internal: added dir to OBOSeries

## [1.0.0] - 2018-08-10
### Added
- Optional scans.tsv file (containing relative path, scan date and time for all scans within a subject/session) can be optionally created
Expand Down
2 changes: 2 additions & 0 deletions GeneralMappingWindow.xib
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
<string>T1w</string>
<string>bold</string>
<string>(fmap)</string>
<string>dir-AP_epi</string>
<string>dir-PA_epi</string>
<string>dwi</string>
<string>T2w</string>
<string>T1map</string>
Expand Down
18 changes: 18 additions & 0 deletions GeneralMappingWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ -(void) annotateAllSeries {
OBOSeries *decoratedSeries = [[OBOSeries alloc] initWithSeries:currentSeries params:[sharedData.seriesDescription objectForKey:currentSeries.name]];
[decoratedSeries setValue:subjectName forKey:@"participant"];
[decoratedSeries setValue:sessionLabel forKey:@"session"];
if ([[decoratedSeries suffix] hasSuffix:@"_epi"]){
// our GUI allows dir-AP_epi and dir-PA_epi "suffixes", translate them into dir & suffix
[decoratedSeries setValue:[self getDirFromSuffix:[decoratedSeries suffix]] forKey:@"dir"];
[decoratedSeries setValue:@"epi" forKey:@"suffix"];
}

[decoratedFromCurrentStudy addObject:decoratedSeries];
[namesFromCurrentStudy addObject:currentSeries.name];
}
Expand Down Expand Up @@ -421,6 +427,18 @@ -(NSString*) createSubjectNameForStudy:(DicomStudy *)study {

}

-(NSString*) getDirFromSuffix:(NSString *)suffix {
// little helper for getting dir label from "dir-(AP|PA)_epi"
NSString *result = @"";
if ([suffix hasPrefix:@"dir-AP"]) {
result = @"AP";
}
else if ([suffix hasPrefix:@"dir-PA"]) {
result = @"PA";
}
return result;
}

-(void) createDatasetDescription {
OBOCollectedData *sharedData = [OBOCollectedData sharedManager];
[sharedData.datasetDescription removeAllObjects];
Expand Down
4 changes: 2 additions & 2 deletions HorosBidsOutput-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<string>1.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.0</string>
<string>1.1.0</string>
<key>MenuTitles</key>
<array>
<string>BIDS output</string>
Expand Down
4 changes: 2 additions & 2 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string>BidsOutputFilter</string>
<key>MenuTitles</key>
<array>
<string>BIDS output</string>
</array>
<key>NSPrincipalClass</key>
<string>BidsOutputFilter</string>
<key>pluginType</key>
<string>Database</string>
</dict>
Expand Down
1 change: 1 addition & 0 deletions OBOSeries.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
@property (nonatomic) NSString *session;
@property (nonatomic) NSString *task;
@property (nonatomic) NSString *acq;
@property (nonatomic) NSString *dir;
@property (nonatomic) NSString *run;

@property (nonatomic, assign) BOOL discard;
Expand Down
13 changes: 12 additions & 1 deletion OBOSeries.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ - (instancetype)init {
_session = @"";
_task = @"";
_acq = @"";
_dir = @"";
_run = @"";

_discard = NO;
Expand All @@ -60,6 +61,7 @@ - (instancetype)initWithSeries:(DicomSeries *)originalSeries {
_session = @"";
_task = @"";
_acq = @"";
_dir = @"";
_run = @"";

_discard = NO;
Expand All @@ -80,6 +82,8 @@ -(instancetype)initWithSeries:(DicomSeries *)originalSeries params:(NSDictionary
_session = @""; // set after initialisation
_task = [params valueForKey:@"task"];
_acq = [params valueForKey:@"acq"];
_dir = @""; // set after initialisation, currently just for for phase-encoding polarity field map
//[params valueForKey:@"dir"] ?: @"" // might be the syntax to get with default
_run = [params valueForKey:@"run"];

_discard = NO;
Expand All @@ -94,7 +98,7 @@ -(NSString*)getBidsPath {
NSArray *anatSuffixList = @[@"T1w", @"T2w", @"T1rho", @"T1map", @"T2map", @"T2star", @"FLAIR", @"FLASH",
@"PD", @"PDmap", @"PDT2", @"inplaneT1", @"inplaneT2", @"angio", @"defacemask",
@"SWImagandphase"];
NSArray *fmapSuffixList = @[@"phasediff", @"magnitude1", @"magnitude2"];
NSArray *fmapSuffixList = @[@"phasediff", @"magnitude1", @"magnitude2", @"epi"];
NSMutableString *path = [[NSMutableString alloc] init];
if ([self discard]){
return path;
Expand Down Expand Up @@ -221,6 +225,13 @@ -(NSString*)getBidsPath {
[path appendString:@"_acq-"];
[path appendString:self.acq];
}

// dir (required for PEpolar field map)
if ([self.suffix isEqualToString:@"epi"]) {
// ADD ce (optional) - not yet supported
[path appendString:@"_dir-"];
[path appendString:self.dir];
}

// run (optional)
if ([self.run length] > 0){
Expand Down
2 changes: 1 addition & 1 deletion OsirixBidsOutput.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

/* Begin PBXFileReference section */
089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
8420023112E829A200E1E9CE /* OsiriXAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = OsiriXAPI.framework; sourceTree = "<group>"; };
Expand Down

0 comments on commit a0ee265

Please sign in to comment.