-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #707 from Pixilib/GaelO2-dev
Add Azure storage, TmtvProcessing Service, improved coverage calculation
- Loading branch information
Showing
40 changed files
with
1,082 additions
and
811 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ on: | |
branches: | ||
- GaelO2 | ||
- GaelO2-dev | ||
- tmtv-inference | ||
tags: | ||
- '*' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ composer.phar | |
.VSCodeCounter/* | ||
|
||
src/* | ||
GaelO2/app/Console/Commands/RealysaTmtvInference.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace App\GaelO\Constants\Enums; | ||
|
||
enum ProcessingMaskEnum: string | ||
{ | ||
case RTSS = 'rtss'; | ||
case SEG = 'seg'; | ||
case NIFTI = 'nifti'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
GaelO2/app/GaelO/Services/GaelOProcessingService/MaskProcessingService.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?php | ||
|
||
namespace App\GaelO\Services\GaelOProcessingService; | ||
|
||
use App\GaelO\Constants\Enums\ProcessingMaskEnum; | ||
use App\GaelO\Services\GaelOProcessingService\GaelOProcessingService; | ||
use App\GaelO\Services\OrthancService; | ||
|
||
class MaskProcessingService | ||
{ | ||
|
||
private string $maskId; | ||
private string $petId; | ||
private string $petSeriesOrthancId; | ||
private GaelOProcessingService $gaelOProcessingService; | ||
private OrthancService $orthancService; | ||
|
||
public function __construct( | ||
OrthancService $orthancService, | ||
GaelOProcessingService $gaelOProcessingService, | ||
) { | ||
$this->gaelOProcessingService = $gaelOProcessingService; | ||
$this->orthancService = $orthancService; | ||
$this->orthancService->setOrthancServer(true); | ||
} | ||
|
||
public function setMaskId(string $maskId) | ||
{ | ||
$this->maskId = $maskId; | ||
} | ||
|
||
public function getMaskId(): string | ||
{ | ||
return $this->maskId; | ||
} | ||
|
||
public function setPetId(string $petId, string $petSeriesOrthancId) | ||
{ | ||
$this->petId = $petId; | ||
$this->petSeriesOrthancId = $petSeriesOrthancId; | ||
} | ||
|
||
public function getMaskAs(ProcessingMaskEnum $type, ?string $orientation = null) : string | ||
{ | ||
if ($type === ProcessingMaskEnum::NIFTI) { | ||
$exportFile = $this->gaelOProcessingService->getMaskDicomOrientation($this->maskId, $orientation, true); | ||
} else if ($type === ProcessingMaskEnum::RTSS) { | ||
$rtssId = $this->gaelOProcessingService->createRtssFromMask($this->petSeriesOrthancId, $this->maskId); | ||
$exportFile = $this->gaelOProcessingService->getRtss($rtssId); | ||
//remove downloaded data from processing | ||
$this->gaelOProcessingService->deleteRessource("rtss", $rtssId); | ||
} else if ($type === ProcessingMaskEnum::SEG) { | ||
$segId = $this->gaelOProcessingService->createSegFromMask($this->petSeriesOrthancId, $this->maskId); | ||
$exportFile = $this->gaelOProcessingService->getSeg($segId); | ||
//remove downloaded data from processing | ||
$this->gaelOProcessingService->deleteRessource("seg", $segId); | ||
} | ||
|
||
return $exportFile; | ||
} | ||
|
||
public function getStatsOfMask(): array | ||
{ | ||
return $this->gaelOProcessingService->getStatsMaskSeries($this->maskId, $this->petId); | ||
} | ||
|
||
public function fragmentMask(): MaskProcessingService | ||
{ | ||
$fragmentedMaskId = $this->gaelOProcessingService->fragmentMask($this->petId, $this->maskId, true); | ||
$maskProcessingService = new MaskProcessingService($this->orthancService, $this->gaelOProcessingService); | ||
$maskProcessingService->setMaskId($fragmentedMaskId); | ||
$maskProcessingService->setPetId($this->petId, $this->petSeriesOrthancId); | ||
return $maskProcessingService; | ||
} | ||
|
||
public function thresholdMaskTo41(): MaskProcessingService | ||
{ | ||
$threshold41MaskId = $this->gaelOProcessingService->thresholdMask($this->maskId, $this->petId, "41%"); | ||
$maskProcessingService = new MaskProcessingService($this->orthancService, $this->gaelOProcessingService); | ||
$maskProcessingService->setMaskId($threshold41MaskId); | ||
$maskProcessingService->setPetId($this->petId, $this->petSeriesOrthancId); | ||
return $maskProcessingService; | ||
} | ||
|
||
public function createTepMaskMip(): string | ||
{ | ||
$mipFragmentedPayload = ['maskId' => $this->maskId, 'delay' => 0.3, 'min' => 0, 'max' => 5, 'inverted' => true, 'orientation' => 'LPI']; | ||
$mipMask = $this->gaelOProcessingService->createMIPForSeries($this->petId, $mipFragmentedPayload); | ||
return $mipMask; | ||
} | ||
} |
Oops, something went wrong.