Skip to content

Commit

Permalink
fixes segmentation app style
Browse files Browse the repository at this point in the history
  • Loading branch information
wyli committed Oct 7, 2019
1 parent d28cefc commit 9628cd8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions niftynet/application/segmentation_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
from niftynet.evaluation.segmentation_evaluator import SegmentationEvaluator
from niftynet.layer.rand_elastic_deform import RandomElasticDeformationLayer

SUPPORTED_INPUT = set(['image', 'label', 'weight', 'sampler', 'inferred',
'value'])
SUPPORTED_INPUT = set(
['image', 'label', 'weight', 'sampler', 'inferred', 'value'])


class SegmentationApplication(BaseApplication):
Expand Down Expand Up @@ -338,7 +338,7 @@ def mixup_switch_sampler(for_training):
inds2 = tf.argsort(tf.map_fn(tf.reduce_sum, tf.cast(d_dict_to_mix['label'] > 0, tf.int64)))
for field in [field for field in mix_fields if field in d_dict]:
d_dict[field] = tf.gather(d_dict[field], indices=inds1)
# note: sorted for opposite directions for d_dict_to_mix
# note: sorted for opposite directions for d_dict_to_mix
d_dict_to_mix[field] = tf.gather(d_dict_to_mix[field], indices=inds2[::-1])

# making the labels dense and one-hot
Expand Down Expand Up @@ -482,8 +482,8 @@ def mixup_switch_sampler(for_training):
def interpret_output(self, batch_output):
if self.is_inference:
return self.output_decoder.decode_batch(
{'window_seg': batch_output['window']}, batch_output[
'location'])
{'window_seg': batch_output['window']},
batch_output['location'])

return True

Expand Down

0 comments on commit 9628cd8

Please sign in to comment.