id int32 0 24.9k | repo stringlengths 5 58 | path stringlengths 9 168 | func_name stringlengths 9 130 | original_string stringlengths 66 10.5k | language stringclasses 1
value | code stringlengths 66 10.5k | code_tokens list | docstring stringlengths 8 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 94 266 |
|---|---|---|---|---|---|---|---|---|---|---|---|
22,900 | dicom/rtkit | lib/rtkit/data_set.rb | RTKIT.DataSet.add | def add(dcm)
id = dcm.value(PATIENTS_ID)
p = patient(id)
if p
p.add(dcm)
else
add_patient(Patient.load(dcm, self))
end
end | ruby | def add(dcm)
id = dcm.value(PATIENTS_ID)
p = patient(id)
if p
p.add(dcm)
else
add_patient(Patient.load(dcm, self))
end
end | [
"def",
"add",
"(",
"dcm",
")",
"id",
"=",
"dcm",
".",
"value",
"(",
"PATIENTS_ID",
")",
"p",
"=",
"patient",
"(",
"id",
")",
"if",
"p",
"p",
".",
"add",
"(",
"dcm",
")",
"else",
"add_patient",
"(",
"Patient",
".",
"load",
"(",
"dcm",
",",
"self... | Adds a DICOM object to the dataset, by adding it
to an existing Patient, or creating a new Patient.
@note To ensure a correct relationship between objects of different
modality, please add DICOM objects in the specific order: images,
structs, plans, doses, rtimages. Alternatively, use the class method
DataS... | [
"Adds",
"a",
"DICOM",
"object",
"to",
"the",
"dataset",
"by",
"adding",
"it",
"to",
"an",
"existing",
"Patient",
"or",
"creating",
"a",
"new",
"Patient",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/data_set.rb#L140-L148 |
22,901 | dicom/rtkit | lib/rtkit/data_set.rb | RTKIT.DataSet.add_frame | def add_frame(frame)
raise ArgumentError, "Invalid argument 'frame'. Expected Frame, got #{frame.class}." unless frame.is_a?(Frame)
# Do not add it again if the frame already belongs to this instance:
@frames << frame unless @associated_frames[frame.uid]
@associated_frames[frame.uid] = frame
... | ruby | def add_frame(frame)
raise ArgumentError, "Invalid argument 'frame'. Expected Frame, got #{frame.class}." unless frame.is_a?(Frame)
# Do not add it again if the frame already belongs to this instance:
@frames << frame unless @associated_frames[frame.uid]
@associated_frames[frame.uid] = frame
... | [
"def",
"add_frame",
"(",
"frame",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'frame'. Expected Frame, got #{frame.class}.\"",
"unless",
"frame",
".",
"is_a?",
"(",
"Frame",
")",
"# Do not add it again if the frame already belongs to this instance:",
"@frames",
"<<",
... | Adds a Frame to this DataSet.
@param [Frame] frame a Frame object to be added to this data set | [
"Adds",
"a",
"Frame",
"to",
"this",
"DataSet",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/data_set.rb#L154-L159 |
22,902 | dicom/rtkit | lib/rtkit/data_set.rb | RTKIT.DataSet.add_patient | def add_patient(patient)
raise ArgumentError, "Invalid argument 'patient'. Expected Patient, got #{patient.class}." unless patient.is_a?(Patient)
# Do not add it again if the patient already belongs to this instance:
@patients << patient unless @associated_patients[patient.id]
@associated_patien... | ruby | def add_patient(patient)
raise ArgumentError, "Invalid argument 'patient'. Expected Patient, got #{patient.class}." unless patient.is_a?(Patient)
# Do not add it again if the patient already belongs to this instance:
@patients << patient unless @associated_patients[patient.id]
@associated_patien... | [
"def",
"add_patient",
"(",
"patient",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'patient'. Expected Patient, got #{patient.class}.\"",
"unless",
"patient",
".",
"is_a?",
"(",
"Patient",
")",
"# Do not add it again if the patient already belongs to this instance:",
"@p... | Adds a Patient to this DataSet.
@param [Patient] patient a Patient object to be added to this data set | [
"Adds",
"a",
"Patient",
"to",
"this",
"DataSet",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/data_set.rb#L165-L170 |
22,903 | dicom/rtkit | lib/rtkit/data_set.rb | RTKIT.DataSet.print | def print
@patients.each do |p|
puts p.name
p.studies.each do |st|
puts " #{st.uid}"
st.series.each do |se|
puts " #{se.modality}"
if se.respond_to?(:images) && se.images
puts " (#{se.images.length} images)"
end
... | ruby | def print
@patients.each do |p|
puts p.name
p.studies.each do |st|
puts " #{st.uid}"
st.series.each do |se|
puts " #{se.modality}"
if se.respond_to?(:images) && se.images
puts " (#{se.images.length} images)"
end
... | [
"def",
"print",
"@patients",
".",
"each",
"do",
"|",
"p",
"|",
"puts",
"p",
".",
"name",
"p",
".",
"studies",
".",
"each",
"do",
"|",
"st",
"|",
"puts",
"\" #{st.uid}\"",
"st",
".",
"series",
".",
"each",
"do",
"|",
"se",
"|",
"puts",
"\" #{se.... | Prints the nested structure of patient - study - series - images that
have been loaded in the DataSet instance. | [
"Prints",
"the",
"nested",
"structure",
"of",
"patient",
"-",
"study",
"-",
"series",
"-",
"images",
"that",
"have",
"been",
"loaded",
"in",
"the",
"DataSet",
"instance",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/data_set.rb#L223-L236 |
22,904 | dicom/rtkit | lib/rtkit/data_set.rb | RTKIT.DataSet.print_rt | def print_rt
@patients.each do |p|
puts p.name
p.studies.each do |st|
puts " Study (UID: #{st.uid})"
st.image_series.each do |is|
puts " #{is.modality} (#{is.images.length} images - UID: #{is.uid})"
is.structs.each do |struct|
puts " ... | ruby | def print_rt
@patients.each do |p|
puts p.name
p.studies.each do |st|
puts " Study (UID: #{st.uid})"
st.image_series.each do |is|
puts " #{is.modality} (#{is.images.length} images - UID: #{is.uid})"
is.structs.each do |struct|
puts " ... | [
"def",
"print_rt",
"@patients",
".",
"each",
"do",
"|",
"p",
"|",
"puts",
"p",
".",
"name",
"p",
".",
"studies",
".",
"each",
"do",
"|",
"st",
"|",
"puts",
"\" Study (UID: #{st.uid})\"",
"st",
".",
"image_series",
".",
"each",
"do",
"|",
"is",
"|",
... | Prints the nested structure of the DataSet from a radiotherapy point of
view, where the various series beneath the patient-study level is presented
in a hiearchy of image series, structure set, rt plan, rt dose and rt image,
in accordance with the object hiearchy used by RTKIT. | [
"Prints",
"the",
"nested",
"structure",
"of",
"the",
"DataSet",
"from",
"a",
"radiotherapy",
"point",
"of",
"view",
"where",
"the",
"various",
"series",
"beneath",
"the",
"patient",
"-",
"study",
"level",
"is",
"presented",
"in",
"a",
"hiearchy",
"of",
"imag... | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/data_set.rb#L243-L265 |
22,905 | jlong/radius | lib/radius/context.rb | Radius.Context.stack | def stack(name, attributes, block)
previous = @tag_binding_stack.last
previous_locals = previous.nil? ? globals : previous.locals
locals = DelegatingOpenStruct.new(previous_locals)
binding = TagBinding.new(self, locals, name, attributes, block)
@tag_binding_stack.push(binding)
... | ruby | def stack(name, attributes, block)
previous = @tag_binding_stack.last
previous_locals = previous.nil? ? globals : previous.locals
locals = DelegatingOpenStruct.new(previous_locals)
binding = TagBinding.new(self, locals, name, attributes, block)
@tag_binding_stack.push(binding)
... | [
"def",
"stack",
"(",
"name",
",",
"attributes",
",",
"block",
")",
"previous",
"=",
"@tag_binding_stack",
".",
"last",
"previous_locals",
"=",
"previous",
".",
"nil?",
"?",
"globals",
":",
"previous",
".",
"locals",
"locals",
"=",
"DelegatingOpenStruct",
".",
... | A convienence method for managing the various parts of the
tag binding stack. | [
"A",
"convienence",
"method",
"for",
"managing",
"the",
"various",
"parts",
"of",
"the",
"tag",
"binding",
"stack",
"."
] | e7b4eab374c6a15e105524ccd663767b8bc91e5b | https://github.com/jlong/radius/blob/e7b4eab374c6a15e105524ccd663767b8bc91e5b/lib/radius/context.rb#L95-L104 |
22,906 | jlong/radius | lib/radius/context.rb | Radius.Context.numeric_specificity | def numeric_specificity(tag_name, nesting_parts)
nesting_parts = nesting_parts.dup
name_parts = tag_name.split(':')
specificity = 0
value = 1
if nesting_parts.last == name_parts.last
while nesting_parts.size > 0
if nesting_parts.last == name_parts.last
... | ruby | def numeric_specificity(tag_name, nesting_parts)
nesting_parts = nesting_parts.dup
name_parts = tag_name.split(':')
specificity = 0
value = 1
if nesting_parts.last == name_parts.last
while nesting_parts.size > 0
if nesting_parts.last == name_parts.last
... | [
"def",
"numeric_specificity",
"(",
"tag_name",
",",
"nesting_parts",
")",
"nesting_parts",
"=",
"nesting_parts",
".",
"dup",
"name_parts",
"=",
"tag_name",
".",
"split",
"(",
"':'",
")",
"specificity",
"=",
"0",
"value",
"=",
"1",
"if",
"nesting_parts",
".",
... | Returns the specificity for +tag_name+ at nesting defined
by +nesting_parts+ as a number. | [
"Returns",
"the",
"specificity",
"for",
"+",
"tag_name",
"+",
"at",
"nesting",
"defined",
"by",
"+",
"nesting_parts",
"+",
"as",
"a",
"number",
"."
] | e7b4eab374c6a15e105524ccd663767b8bc91e5b | https://github.com/jlong/radius/blob/e7b4eab374c6a15e105524ccd663767b8bc91e5b/lib/radius/context.rb#L128-L145 |
22,907 | dicom/rtkit | lib/rtkit/coordinate.rb | RTKIT.Coordinate.translate | def translate(x, y, z)
@x += x.to_f
@y += y.to_f
@z += z.to_f
end | ruby | def translate(x, y, z)
@x += x.to_f
@y += y.to_f
@z += z.to_f
end | [
"def",
"translate",
"(",
"x",
",",
"y",
",",
"z",
")",
"@x",
"+=",
"x",
".",
"to_f",
"@y",
"+=",
"y",
".",
"to_f",
"@z",
"+=",
"z",
".",
"to_f",
"end"
] | Moves the coordinate according to the given offset vector.
@param [Float] x the offset along the x axis (in units of mm)
@param [Float] y the offset along the y axis (in units of mm)
@param [Float] z the offset along the z axis (in units of mm) | [
"Moves",
"the",
"coordinate",
"according",
"to",
"the",
"given",
"offset",
"vector",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/coordinate.rb#L85-L89 |
22,908 | celluloid/dcell | lib/dcell/resource_manager.rb | DCell.ResourceManager.register | def register(id, &block)
ref = __get id
return ref.__getobj__ if ref && ref.weakref_alive?
item = block.call
return nil unless item
__register id, item
end | ruby | def register(id, &block)
ref = __get id
return ref.__getobj__ if ref && ref.weakref_alive?
item = block.call
return nil unless item
__register id, item
end | [
"def",
"register",
"(",
"id",
",",
"&",
"block",
")",
"ref",
"=",
"__get",
"id",
"return",
"ref",
".",
"__getobj__",
"if",
"ref",
"&&",
"ref",
".",
"weakref_alive?",
"item",
"=",
"block",
".",
"call",
"return",
"nil",
"unless",
"item",
"__register",
"i... | Register an item inside the cache if it does not yet exist
If the item is not found inside the cache the block attached should return a valid reference | [
"Register",
"an",
"item",
"inside",
"the",
"cache",
"if",
"it",
"does",
"not",
"yet",
"exist",
"If",
"the",
"item",
"is",
"not",
"found",
"inside",
"the",
"cache",
"the",
"block",
"attached",
"should",
"return",
"a",
"valid",
"reference"
] | a8fecfae220cb2c20d3761bc27880e4133aba498 | https://github.com/celluloid/dcell/blob/a8fecfae220cb2c20d3761bc27880e4133aba498/lib/dcell/resource_manager.rb#L44-L50 |
22,909 | celluloid/dcell | lib/dcell/resource_manager.rb | DCell.ResourceManager.each | def each
@lock.synchronize do
@items.each do |id, ref|
begin
yield id, ref.__getobj__
rescue WeakRef::RefError
end
end
end
end | ruby | def each
@lock.synchronize do
@items.each do |id, ref|
begin
yield id, ref.__getobj__
rescue WeakRef::RefError
end
end
end
end | [
"def",
"each",
"@lock",
".",
"synchronize",
"do",
"@items",
".",
"each",
"do",
"|",
"id",
",",
"ref",
"|",
"begin",
"yield",
"id",
",",
"ref",
".",
"__getobj__",
"rescue",
"WeakRef",
"::",
"RefError",
"end",
"end",
"end",
"end"
] | Iterates over registered and alive items | [
"Iterates",
"over",
"registered",
"and",
"alive",
"items"
] | a8fecfae220cb2c20d3761bc27880e4133aba498 | https://github.com/celluloid/dcell/blob/a8fecfae220cb2c20d3761bc27880e4133aba498/lib/dcell/resource_manager.rb#L53-L62 |
22,910 | celluloid/dcell | lib/dcell/resource_manager.rb | DCell.ResourceManager.clear | def clear
@lock.synchronize do
if block_given?
@items.each do |id, ref|
begin
yield id, ref.__getobj__
rescue WeakRef::RefError
end
end
end
@items.clear
end
end | ruby | def clear
@lock.synchronize do
if block_given?
@items.each do |id, ref|
begin
yield id, ref.__getobj__
rescue WeakRef::RefError
end
end
end
@items.clear
end
end | [
"def",
"clear",
"@lock",
".",
"synchronize",
"do",
"if",
"block_given?",
"@items",
".",
"each",
"do",
"|",
"id",
",",
"ref",
"|",
"begin",
"yield",
"id",
",",
"ref",
".",
"__getobj__",
"rescue",
"WeakRef",
"::",
"RefError",
"end",
"end",
"end",
"@items",... | Clears all items from the cache
If block is given, iterates over the cached items | [
"Clears",
"all",
"items",
"from",
"the",
"cache",
"If",
"block",
"is",
"given",
"iterates",
"over",
"the",
"cached",
"items"
] | a8fecfae220cb2c20d3761bc27880e4133aba498 | https://github.com/celluloid/dcell/blob/a8fecfae220cb2c20d3761bc27880e4133aba498/lib/dcell/resource_manager.rb#L66-L78 |
22,911 | celluloid/dcell | lib/dcell/resource_manager.rb | DCell.ResourceManager.find | def find(id)
@lock.synchronize do
begin
ref = @items[id]
return unless ref
ref.__getobj__
rescue WeakRef::RefError
# :nocov:
@items.delete id
nil
# :nocov:
end
end
end | ruby | def find(id)
@lock.synchronize do
begin
ref = @items[id]
return unless ref
ref.__getobj__
rescue WeakRef::RefError
# :nocov:
@items.delete id
nil
# :nocov:
end
end
end | [
"def",
"find",
"(",
"id",
")",
"@lock",
".",
"synchronize",
"do",
"begin",
"ref",
"=",
"@items",
"[",
"id",
"]",
"return",
"unless",
"ref",
"ref",
".",
"__getobj__",
"rescue",
"WeakRef",
"::",
"RefError",
"# :nocov:",
"@items",
".",
"delete",
"id",
"nil"... | Finds an item by its ID | [
"Finds",
"an",
"item",
"by",
"its",
"ID"
] | a8fecfae220cb2c20d3761bc27880e4133aba498 | https://github.com/celluloid/dcell/blob/a8fecfae220cb2c20d3761bc27880e4133aba498/lib/dcell/resource_manager.rb#L81-L94 |
22,912 | dicom/rtkit | lib/rtkit/drr/attenuation.rb | RTKIT.Attenuation.vector_attenuation | def vector_attenuation(h_units, lengths)
raise ArgumentError, "Incosistent arguments. Expected both NArrays to have the same length, go #{h_units.length} and #{lengths.length}" if h_units.length != lengths.length
# Note that the lengths are converted to units of cm in the calculation.
# The exponentia... | ruby | def vector_attenuation(h_units, lengths)
raise ArgumentError, "Incosistent arguments. Expected both NArrays to have the same length, go #{h_units.length} and #{lengths.length}" if h_units.length != lengths.length
# Note that the lengths are converted to units of cm in the calculation.
# The exponentia... | [
"def",
"vector_attenuation",
"(",
"h_units",
",",
"lengths",
")",
"raise",
"ArgumentError",
",",
"\"Incosistent arguments. Expected both NArrays to have the same length, go #{h_units.length} and #{lengths.length}\"",
"if",
"h_units",
".",
"length",
"!=",
"lengths",
".",
"length",... | Calculates the attentuation for a vector pair of hounsfield units and lengths.
@param [NArray<Integer>] h_units a vector of Hounsfield units
@param [NArray<Float>] lengths a vector of lengths (in units of mm)
@return [Float] the calculated attenuation of a ray through the given medium | [
"Calculates",
"the",
"attentuation",
"for",
"a",
"vector",
"pair",
"of",
"hounsfield",
"units",
"and",
"lengths",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/drr/attenuation.rb#L118-L123 |
22,913 | dicom/rtkit | lib/rtkit/drr/attenuation.rb | RTKIT.Attenuation.determine_coefficient | def determine_coefficient
# Array of photon energies (in units of MeV).
@energies = [
0.001,
0.0015,
0.002,
0.003,
0.004,
0.005,
0.006,
0.008,
0.01,
0.015,
0.02,
0.03,
0.04,
0.05,
0.06,
... | ruby | def determine_coefficient
# Array of photon energies (in units of MeV).
@energies = [
0.001,
0.0015,
0.002,
0.003,
0.004,
0.005,
0.006,
0.008,
0.01,
0.015,
0.02,
0.03,
0.04,
0.05,
0.06,
... | [
"def",
"determine_coefficient",
"# Array of photon energies (in units of MeV).",
"@energies",
"=",
"[",
"0.001",
",",
"0.0015",
",",
"0.002",
",",
"0.003",
",",
"0.004",
",",
"0.005",
",",
"0.006",
",",
"0.008",
",",
"0.01",
",",
"0.015",
",",
"0.02",
",",
"0.... | Determines the attenuation coefficient to use, based on the given energy. | [
"Determines",
"the",
"attenuation",
"coefficient",
"to",
"use",
"based",
"on",
"the",
"given",
"energy",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/drr/attenuation.rb#L131-L232 |
22,914 | zmoazeni/harvested | lib/harvest/user.rb | Harvest.User.timezone= | def timezone=(timezone)
tz = timezone.to_s.downcase
case tz
when 'cst', 'cdt' then self.timezone = 'america/chicago'
when 'est', 'edt' then self.timezone = 'america/new_york'
when 'mst', 'mdt' then self.timezone = 'america/denver'
when 'pst', 'pdt' then self.timezone = 'america/los_a... | ruby | def timezone=(timezone)
tz = timezone.to_s.downcase
case tz
when 'cst', 'cdt' then self.timezone = 'america/chicago'
when 'est', 'edt' then self.timezone = 'america/new_york'
when 'mst', 'mdt' then self.timezone = 'america/denver'
when 'pst', 'pdt' then self.timezone = 'america/los_a... | [
"def",
"timezone",
"=",
"(",
"timezone",
")",
"tz",
"=",
"timezone",
".",
"to_s",
".",
"downcase",
"case",
"tz",
"when",
"'cst'",
",",
"'cdt'",
"then",
"self",
".",
"timezone",
"=",
"'america/chicago'",
"when",
"'est'",
",",
"'edt'",
"then",
"self",
".",... | Sets the timezone for the user. This can be done in a variety of ways.
== Examples
user.timezone = :cst # the easiest way. CST, EST, MST, and PST are supported
user.timezone = 'america/chicago' # a little more verbose
user.timezone = 'Central Time (US & Canada)' # the most explicit way | [
"Sets",
"the",
"timezone",
"for",
"the",
"user",
".",
"This",
"can",
"be",
"done",
"in",
"a",
"variety",
"of",
"ways",
"."
] | 33d26049651fde6adf651d5c8aff8fff97156210 | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/user.rb#L42-L56 |
22,915 | dicom/rtkit | lib/rtkit/dose.rb | RTKIT.Dose.bed | def bed(d, alpha_beta)
# FIXME: Perhaps better to use number of fractions instead of fraction dose?!
raise ArgumentError, "A positive alpha_beta factor is required (got: #{alpha_beta})." unless alpha_beta.to_f > 0.0
@value * (1 + d.to_f/alpha_beta.to_f)
end | ruby | def bed(d, alpha_beta)
# FIXME: Perhaps better to use number of fractions instead of fraction dose?!
raise ArgumentError, "A positive alpha_beta factor is required (got: #{alpha_beta})." unless alpha_beta.to_f > 0.0
@value * (1 + d.to_f/alpha_beta.to_f)
end | [
"def",
"bed",
"(",
"d",
",",
"alpha_beta",
")",
"# FIXME: Perhaps better to use number of fractions instead of fraction dose?!",
"raise",
"ArgumentError",
",",
"\"A positive alpha_beta factor is required (got: #{alpha_beta}).\"",
"unless",
"alpha_beta",
".",
"to_f",
">",
"0.0",
"... | Calculates the biologically equivalent dose, BED. This is the theoretical
limit of the equivalent dose delivered in small fractions, i.e. when
complete repair takes place.
@param [#to_f] d fraction dose
@param [#to_f] alpha_beta the alpha/beta tissue factor to be used
@return [Float] the biologically equivalent d... | [
"Calculates",
"the",
"biologically",
"equivalent",
"dose",
"BED",
".",
"This",
"is",
"the",
"theoretical",
"limit",
"of",
"the",
"equivalent",
"dose",
"delivered",
"in",
"small",
"fractions",
"i",
".",
"e",
".",
"when",
"complete",
"repair",
"takes",
"place",
... | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/dose.rb#L59-L63 |
22,916 | dicom/rtkit | lib/rtkit/drr/ray.rb | RTKIT.Ray.trace | def trace
# Set up instance varibles which depends on the initial conditions.
# Delta positions determines whether the ray's travel is positive
# or negative in the three directions.
delta_x = @p1.x < @p2.x ? 1 : -1
delta_y = @p1.y < @p2.y ? 1 : -1
delta_z = @p1.z < @p2.z ? 1 : -1
... | ruby | def trace
# Set up instance varibles which depends on the initial conditions.
# Delta positions determines whether the ray's travel is positive
# or negative in the three directions.
delta_x = @p1.x < @p2.x ? 1 : -1
delta_y = @p1.y < @p2.y ? 1 : -1
delta_z = @p1.z < @p2.z ? 1 : -1
... | [
"def",
"trace",
"# Set up instance varibles which depends on the initial conditions.",
"# Delta positions determines whether the ray's travel is positive",
"# or negative in the three directions.",
"delta_x",
"=",
"@p1",
".",
"x",
"<",
"@p2",
".",
"x",
"?",
"1",
":",
"-",
"1",
... | Performs ray tracing, where the ray's possible intersection of the
associated voxel space is investigated for the ray's movement from
its source coordinate to its target coordinate.
The resulting density experienced by the ray through the voxel space
is stored in the 'd' attribute. The indices of the voxel space
... | [
"Performs",
"ray",
"tracing",
"where",
"the",
"ray",
"s",
"possible",
"intersection",
"of",
"the",
"associated",
"voxel",
"space",
"is",
"investigated",
"for",
"the",
"ray",
"s",
"movement",
"from",
"its",
"source",
"coordinate",
"to",
"its",
"target",
"coordi... | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/drr/ray.rb#L306-L361 |
22,917 | dicom/rtkit | lib/rtkit/drr/ray.rb | RTKIT.Ray.alpha_min | def alpha_min(fractions)
fractions.compact.collect { |a| a >= 0 ? a : nil}.compact.min
end | ruby | def alpha_min(fractions)
fractions.compact.collect { |a| a >= 0 ? a : nil}.compact.min
end | [
"def",
"alpha_min",
"(",
"fractions",
")",
"fractions",
".",
"compact",
".",
"collect",
"{",
"|",
"a",
"|",
"a",
">=",
"0",
"?",
"a",
":",
"nil",
"}",
".",
"compact",
".",
"min",
"end"
] | Gives the minimum value among the directional fractions given, taking
into account that some of them may be nil, negative, or even -INFINITY,
and thus needs to be excluded before extracting the valid minimum value.
@param [Array<Float, NilClass>] fractions a collection of alpha values
@return [Float] the minimum v... | [
"Gives",
"the",
"minimum",
"value",
"among",
"the",
"directional",
"fractions",
"given",
"taking",
"into",
"account",
"that",
"some",
"of",
"them",
"may",
"be",
"nil",
"negative",
"or",
"even",
"-",
"INFINITY",
"and",
"thus",
"needs",
"to",
"be",
"excluded",... | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/drr/ray.rb#L374-L376 |
22,918 | dicom/rtkit | lib/rtkit/drr/ray.rb | RTKIT.Ray.first_intersection_point_in_voxel_space | def first_intersection_point_in_voxel_space
a_x_min = ax(@i_min)
a_y_min = ay(@j_min)
a_z_min = az(@k_min)
a_x_max = ax(@i_max)
a_y_max = ay(@j_max)
a_z_max = az(@k_max)
alpha_x = alpha_min_first_intersection([a_x_min, a_x_max])
alpha_y = alpha_min_first_intersection([a_y... | ruby | def first_intersection_point_in_voxel_space
a_x_min = ax(@i_min)
a_y_min = ay(@j_min)
a_z_min = az(@k_min)
a_x_max = ax(@i_max)
a_y_max = ay(@j_max)
a_z_max = az(@k_max)
alpha_x = alpha_min_first_intersection([a_x_min, a_x_max])
alpha_y = alpha_min_first_intersection([a_y... | [
"def",
"first_intersection_point_in_voxel_space",
"a_x_min",
"=",
"ax",
"(",
"@i_min",
")",
"a_y_min",
"=",
"ay",
"(",
"@j_min",
")",
"a_z_min",
"=",
"az",
"(",
"@k_min",
")",
"a_x_max",
"=",
"ax",
"(",
"@i_max",
")",
"a_y_max",
"=",
"ay",
"(",
"@j_max",
... | Determines the alpha values for the first intersection after
the ray has entered the voxel space.
@return [Array<Float>] directional x, y and z alpha values | [
"Determines",
"the",
"alpha",
"values",
"for",
"the",
"first",
"intersection",
"after",
"the",
"ray",
"has",
"entered",
"the",
"voxel",
"space",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/drr/ray.rb#L403-L414 |
22,919 | dicom/rtkit | lib/rtkit/drr/ray.rb | RTKIT.Ray.indices_first_intersection | def indices_first_intersection(axf, ayf, azf)
i, j, k = nil, nil, nil
# In cases of perpendicular ray travel, one or two arguments may be
# -INFINITY, which must be excluded when searching for the minimum value:
af_min = alpha_min([axf, ayf, azf])
sorted_real_alpha_values([axf, ayf, azf]).... | ruby | def indices_first_intersection(axf, ayf, azf)
i, j, k = nil, nil, nil
# In cases of perpendicular ray travel, one or two arguments may be
# -INFINITY, which must be excluded when searching for the minimum value:
af_min = alpha_min([axf, ayf, azf])
sorted_real_alpha_values([axf, ayf, azf]).... | [
"def",
"indices_first_intersection",
"(",
"axf",
",",
"ayf",
",",
"azf",
")",
"i",
",",
"j",
",",
"k",
"=",
"nil",
",",
"nil",
",",
"nil",
"# In cases of perpendicular ray travel, one or two arguments may be",
"# -INFINITY, which must be excluded when searching for the mini... | Determines the voxel indices of the first intersection.
@param [Float] axf a directional x alpha value for the ray's first intersection in voxel space
@param [Float] ayf a directional y alpha value for the ray's first intersection in voxel space
@param [Float] azf a directional z alpha value for the ray's first int... | [
"Determines",
"the",
"voxel",
"indices",
"of",
"the",
"first",
"intersection",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/drr/ray.rb#L423-L439 |
22,920 | dicom/rtkit | lib/rtkit/drr/ray.rb | RTKIT.Ray.indices_within_voxel_space | def indices_within_voxel_space(i, j, k)
if [i, j, k].min >= 0
if i < @vs.nx && j < @vs.nz && k < @vs.nz
true
else
false
end
else
false
end
end | ruby | def indices_within_voxel_space(i, j, k)
if [i, j, k].min >= 0
if i < @vs.nx && j < @vs.nz && k < @vs.nz
true
else
false
end
else
false
end
end | [
"def",
"indices_within_voxel_space",
"(",
"i",
",",
"j",
",",
"k",
")",
"if",
"[",
"i",
",",
"j",
",",
"k",
"]",
".",
"min",
">=",
"0",
"if",
"i",
"<",
"@vs",
".",
"nx",
"&&",
"j",
"<",
"@vs",
".",
"nz",
"&&",
"k",
"<",
"@vs",
".",
"nz",
... | Checks whether the given voxel indices describe an index
that is within the associated voxel space.
@param [Integer] i the first volume index (column)
@param [Integer] j the second volume index (row)
@param [Integer] k the third volume index (slice)
@return [Boolean] true if within, and false if not | [
"Checks",
"whether",
"the",
"given",
"voxel",
"indices",
"describe",
"an",
"index",
"that",
"is",
"within",
"the",
"associated",
"voxel",
"space",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/drr/ray.rb#L449-L459 |
22,921 | dicom/rtkit | lib/rtkit/drr/ray.rb | RTKIT.Ray.sorted_real_alpha_values | def sorted_real_alpha_values(fractions)
fractions.compact.collect { |a| a >= 0 && a.finite? ? a : nil}.compact.sort
end | ruby | def sorted_real_alpha_values(fractions)
fractions.compact.collect { |a| a >= 0 && a.finite? ? a : nil}.compact.sort
end | [
"def",
"sorted_real_alpha_values",
"(",
"fractions",
")",
"fractions",
".",
"compact",
".",
"collect",
"{",
"|",
"a",
"|",
"a",
">=",
"0",
"&&",
"a",
".",
"finite?",
"?",
"a",
":",
"nil",
"}",
".",
"compact",
".",
"sort",
"end"
] | Gives a sorted array of the directional fractions given, taking
into account that some of them may be nil, negative, or even -INFINITY,
and thus needs to be excluded before sorting.
@param [Array<Float, NilClass>] fractions a collection of alpha values
@return [Array<Float>] sorted (valid) alpha values | [
"Gives",
"a",
"sorted",
"array",
"of",
"the",
"directional",
"fractions",
"given",
"taking",
"into",
"account",
"that",
"some",
"of",
"them",
"may",
"be",
"nil",
"negative",
"or",
"even",
"-",
"INFINITY",
"and",
"thus",
"needs",
"to",
"be",
"excluded",
"be... | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/drr/ray.rb#L621-L623 |
22,922 | jlong/radius | lib/radius/parser.rb | Radius.Parser.parse | def parse(string)
@stack = [ ParseContainerTag.new { |t| Utility.array_to_s(t.contents) } ]
tokenize(string)
stack_up
@stack.last.to_s
end | ruby | def parse(string)
@stack = [ ParseContainerTag.new { |t| Utility.array_to_s(t.contents) } ]
tokenize(string)
stack_up
@stack.last.to_s
end | [
"def",
"parse",
"(",
"string",
")",
"@stack",
"=",
"[",
"ParseContainerTag",
".",
"new",
"{",
"|",
"t",
"|",
"Utility",
".",
"array_to_s",
"(",
"t",
".",
"contents",
")",
"}",
"]",
"tokenize",
"(",
"string",
")",
"stack_up",
"@stack",
".",
"last",
".... | Creates a new parser object initialized with a Context.
Parses string for tags, expands them, and returns the result. | [
"Creates",
"a",
"new",
"parser",
"object",
"initialized",
"with",
"a",
"Context",
".",
"Parses",
"string",
"for",
"tags",
"expands",
"them",
"and",
"returns",
"the",
"result",
"."
] | e7b4eab374c6a15e105524ccd663767b8bc91e5b | https://github.com/jlong/radius/blob/e7b4eab374c6a15e105524ccd663767b8bc91e5b/lib/radius/parser.rb#L30-L35 |
22,923 | dicom/rtkit | lib/rtkit/series.rb | RTKIT.Series.add_attributes_to_dcm | def add_attributes_to_dcm(dcm)
# Series level:
dcm.add_element(SOP_CLASS, @class_uid)
dcm.add_element(SERIES_UID, @series_uid)
dcm.add_element(SERIES_NUMBER, '1')
# Study level:
dcm.add_element(STUDY_DATE, @study.date)
dcm.add_element(STUDY_TIME, @study.time)
dcm.add_elem... | ruby | def add_attributes_to_dcm(dcm)
# Series level:
dcm.add_element(SOP_CLASS, @class_uid)
dcm.add_element(SERIES_UID, @series_uid)
dcm.add_element(SERIES_NUMBER, '1')
# Study level:
dcm.add_element(STUDY_DATE, @study.date)
dcm.add_element(STUDY_TIME, @study.time)
dcm.add_elem... | [
"def",
"add_attributes_to_dcm",
"(",
"dcm",
")",
"# Series level:",
"dcm",
".",
"add_element",
"(",
"SOP_CLASS",
",",
"@class_uid",
")",
"dcm",
".",
"add_element",
"(",
"SERIES_UID",
",",
"@series_uid",
")",
"dcm",
".",
"add_element",
"(",
"SERIES_NUMBER",
",",
... | Creates a new Series instance. The Series Instance UID string is used to
uniquely identify a Series.
@param [String] series_uid the Series Instance UID string
@param [String] modality the modality string of the series (e.g. 'CT', 'RTSTRUCT')
@param [Study] study the Study instance which this Series belongs to
@pa... | [
"Creates",
"a",
"new",
"Series",
"instance",
".",
"The",
"Series",
"Instance",
"UID",
"string",
"is",
"used",
"to",
"uniquely",
"identify",
"a",
"Series",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/series.rb#L62-L83 |
22,924 | dicom/rtkit | lib/rtkit/staple.rb | RTKIT.Staple.solve | def solve
set_parameters
# Vectors holding the values used for calculating the weights:
a = NArray.float(@n)
b = NArray.float(@n)
# Set an initial estimate for the probabilities of true segmentation:
@n.times do |i|
@weights_current[i] = @decisions[i, true].mean
end
... | ruby | def solve
set_parameters
# Vectors holding the values used for calculating the weights:
a = NArray.float(@n)
b = NArray.float(@n)
# Set an initial estimate for the probabilities of true segmentation:
@n.times do |i|
@weights_current[i] = @decisions[i, true].mean
end
... | [
"def",
"solve",
"set_parameters",
"# Vectors holding the values used for calculating the weights:",
"a",
"=",
"NArray",
".",
"float",
"(",
"@n",
")",
"b",
"=",
"NArray",
".",
"float",
"(",
"@n",
")",
"# Set an initial estimate for the probabilities of true segmentation:",
"... | Applies the STAPLE algorithm to the dataset to determine the true hidden
segmentation as well as scoring the various segmentations. | [
"Applies",
"the",
"STAPLE",
"algorithm",
"to",
"the",
"dataset",
"to",
"determine",
"the",
"true",
"hidden",
"segmentation",
"as",
"well",
"as",
"scoring",
"the",
"various",
"segmentations",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/staple.rb#L141-L215 |
22,925 | dicom/rtkit | lib/rtkit/staple.rb | RTKIT.Staple.construct_segmentation_volume | def construct_segmentation_volume
if @volumes.first.shape == @original_volumes.first.shape
# Just reshape the vector (and ensure that it remains byte type):
@true_segmentation = @true_segmentation_vector.reshape(*@original_volumes.first.shape).to_type(1)
else
# Need to take into acco... | ruby | def construct_segmentation_volume
if @volumes.first.shape == @original_volumes.first.shape
# Just reshape the vector (and ensure that it remains byte type):
@true_segmentation = @true_segmentation_vector.reshape(*@original_volumes.first.shape).to_type(1)
else
# Need to take into acco... | [
"def",
"construct_segmentation_volume",
"if",
"@volumes",
".",
"first",
".",
"shape",
"==",
"@original_volumes",
".",
"first",
".",
"shape",
"# Just reshape the vector (and ensure that it remains byte type):",
"@true_segmentation",
"=",
"@true_segmentation_vector",
".",
"reshap... | Reshapes the true segmentation vector to a volume which is comparable
with the input volumes for the Staple instance. If volume reduction has
been peformed, this must be taken into account. | [
"Reshapes",
"the",
"true",
"segmentation",
"vector",
"to",
"a",
"volume",
"which",
"is",
"comparable",
"with",
"the",
"input",
"volumes",
"for",
"the",
"Staple",
"instance",
".",
"If",
"volume",
"reduction",
"has",
"been",
"peformed",
"this",
"must",
"be",
"... | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/staple.rb#L233-L245 |
22,926 | dicom/rtkit | lib/rtkit/staple.rb | RTKIT.Staple.set_parameters | def set_parameters
# Convert the volumes to vectors:
@vectors = Array.new
@volumes.each {|volume| @vectors << volume.flatten}
verify_equal_vector_lengths
# Number of voxels:
@n = @vectors.first.length
# Number of raters:
@r = @vectors.length
# Decisions array:
... | ruby | def set_parameters
# Convert the volumes to vectors:
@vectors = Array.new
@volumes.each {|volume| @vectors << volume.flatten}
verify_equal_vector_lengths
# Number of voxels:
@n = @vectors.first.length
# Number of raters:
@r = @vectors.length
# Decisions array:
... | [
"def",
"set_parameters",
"# Convert the volumes to vectors:",
"@vectors",
"=",
"Array",
".",
"new",
"@volumes",
".",
"each",
"{",
"|",
"volume",
"|",
"@vectors",
"<<",
"volume",
".",
"flatten",
"}",
"verify_equal_vector_lengths",
"# Number of voxels:",
"@n",
"=",
"@... | Sets the instance attributes used by the STAPLE algorithm. | [
"Sets",
"the",
"instance",
"attributes",
"used",
"by",
"the",
"STAPLE",
"algorithm",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/staple.rb#L249-L281 |
22,927 | dicom/rtkit | lib/rtkit/staple.rb | RTKIT.Staple.verify_equal_vector_lengths | def verify_equal_vector_lengths
vector_lengths = @vectors.collect{|vector| vector.length}
raise IndexError, "Unexpected behaviour: The vectors going into the STAPLE analysis have different lengths." unless vector_lengths.uniq.length == 1
end | ruby | def verify_equal_vector_lengths
vector_lengths = @vectors.collect{|vector| vector.length}
raise IndexError, "Unexpected behaviour: The vectors going into the STAPLE analysis have different lengths." unless vector_lengths.uniq.length == 1
end | [
"def",
"verify_equal_vector_lengths",
"vector_lengths",
"=",
"@vectors",
".",
"collect",
"{",
"|",
"vector",
"|",
"vector",
".",
"length",
"}",
"raise",
"IndexError",
",",
"\"Unexpected behaviour: The vectors going into the STAPLE analysis have different lengths.\"",
"unless",
... | Ensures that the number of voxels are the same for all segmentation
vectors going into the STAPLE analysis.
raise [IndexError] if the vectors to be compared in the STAPLE analysis are of different lengths | [
"Ensures",
"that",
"the",
"number",
"of",
"voxels",
"are",
"the",
"same",
"for",
"all",
"segmentation",
"vectors",
"going",
"into",
"the",
"STAPLE",
"analysis",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/staple.rb#L320-L323 |
22,928 | dicom/rtkit | lib/rtkit/study.rb | RTKIT.Study.add | def add(dcm)
raise ArgumentError, "Invalid argument 'dcm'. Expected DObject, got #{dcm.class}." unless dcm.is_a?(DICOM::DObject)
existing_series = @associated_series[dcm.value(SERIES_UID)]
if existing_series
existing_series.add(dcm)
else
# New series (series subclass depends on m... | ruby | def add(dcm)
raise ArgumentError, "Invalid argument 'dcm'. Expected DObject, got #{dcm.class}." unless dcm.is_a?(DICOM::DObject)
existing_series = @associated_series[dcm.value(SERIES_UID)]
if existing_series
existing_series.add(dcm)
else
# New series (series subclass depends on m... | [
"def",
"add",
"(",
"dcm",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'dcm'. Expected DObject, got #{dcm.class}.\"",
"unless",
"dcm",
".",
"is_a?",
"(",
"DICOM",
"::",
"DObject",
")",
"existing_series",
"=",
"@associated_series",
"[",
"dcm",
".",
"value",
... | Creates a new Study instance. The Study Instance UID string is used to
uniquely identify a study.
@param [String] study_uid the Study Instance UID string
@param [Patient] patient the Patient instance which this Study is associated with
@param [Hash] options the options to use for creating the study
@option option... | [
"Creates",
"a",
"new",
"Study",
"instance",
".",
"The",
"Study",
"Instance",
"UID",
"string",
"is",
"used",
"to",
"uniquely",
"identify",
"a",
"study",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/study.rb#L92-L119 |
22,929 | dicom/rtkit | lib/rtkit/study.rb | RTKIT.Study.add_series | def add_series(series)
raise ArgumentError, "Invalid argument 'series'. Expected Series, got #{series.class}." unless series.is_a?(Series)
# Do not add it again if the series already belongs to this instance:
@series << series unless @associated_series[series.uid]
@image_series << series if seri... | ruby | def add_series(series)
raise ArgumentError, "Invalid argument 'series'. Expected Series, got #{series.class}." unless series.is_a?(Series)
# Do not add it again if the series already belongs to this instance:
@series << series unless @associated_series[series.uid]
@image_series << series if seri... | [
"def",
"add_series",
"(",
"series",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'series'. Expected Series, got #{series.class}.\"",
"unless",
"series",
".",
"is_a?",
"(",
"Series",
")",
"# Do not add it again if the series already belongs to this instance:",
"@series",
... | Adds a Series to this Study.
@param [Series] series a series instance to be associated with this study | [
"Adds",
"a",
"Series",
"to",
"this",
"Study",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/study.rb#L141-L148 |
22,930 | dicom/rtkit | lib/rtkit/selection.rb | RTKIT.Selection.shift | def shift(delta_col, delta_row)
raise ArgumentError, "Invalid argument 'delta_col'. Expected Integer, got #{delta_col.class}." unless delta_col.is_a?(Integer)
raise ArgumentError, "Invalid argument 'delta_row'. Expected Integer, got #{delta_row.class}." unless delta_row.is_a?(Integer)
new_columns = @i... | ruby | def shift(delta_col, delta_row)
raise ArgumentError, "Invalid argument 'delta_col'. Expected Integer, got #{delta_col.class}." unless delta_col.is_a?(Integer)
raise ArgumentError, "Invalid argument 'delta_row'. Expected Integer, got #{delta_row.class}." unless delta_row.is_a?(Integer)
new_columns = @i... | [
"def",
"shift",
"(",
"delta_col",
",",
"delta_row",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'delta_col'. Expected Integer, got #{delta_col.class}.\"",
"unless",
"delta_col",
".",
"is_a?",
"(",
"Integer",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argumen... | Shifts the indices of this selection by the specified number of columns
and rows. Positive arguments increment the column and row indices.
@note No out of bounds check is performed for indices that are shifted
past the image boundary!
@param [Integer] delta_col the desired column shift
@param [Integer] delta_ro... | [
"Shifts",
"the",
"indices",
"of",
"this",
"selection",
"by",
"the",
"specified",
"number",
"of",
"columns",
"and",
"rows",
".",
"Positive",
"arguments",
"increment",
"the",
"column",
"and",
"row",
"indices",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/selection.rb#L117-L124 |
22,931 | dicom/rtkit | lib/rtkit/selection.rb | RTKIT.Selection.shift_columns | def shift_columns(delta)
raise ArgumentError, "Invalid argument 'delta'. Expected Integer, got #{delta.class}." unless delta.is_a?(Integer)
new_columns = @indices.collect {|index| index % @bin_image.columns + delta}
new_rows = rows
# Set new indices:
@indices = Array.new(new_columns.length... | ruby | def shift_columns(delta)
raise ArgumentError, "Invalid argument 'delta'. Expected Integer, got #{delta.class}." unless delta.is_a?(Integer)
new_columns = @indices.collect {|index| index % @bin_image.columns + delta}
new_rows = rows
# Set new indices:
@indices = Array.new(new_columns.length... | [
"def",
"shift_columns",
"(",
"delta",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'delta'. Expected Integer, got #{delta.class}.\"",
"unless",
"delta",
".",
"is_a?",
"(",
"Integer",
")",
"new_columns",
"=",
"@indices",
".",
"collect",
"{",
"|",
"index",
"|... | Shifts the indices of this selection by the specified number of columns.
A positive argument increment the column indices.
@note No out of bounds check is performed for indices that are shifted
past the image boundary.
@param [Integer] delta the desired column shift
@return [Array] the shifted indices | [
"Shifts",
"the",
"indices",
"of",
"this",
"selection",
"by",
"the",
"specified",
"number",
"of",
"columns",
".",
"A",
"positive",
"argument",
"increment",
"the",
"column",
"indices",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/selection.rb#L160-L166 |
22,932 | celluloid/dcell | lib/dcell/node_manager.rb | DCell.NodeManager.each | def each
Directory.each do |id|
remote = NodeCache.register id
next unless remote
yield remote
end
end | ruby | def each
Directory.each do |id|
remote = NodeCache.register id
next unless remote
yield remote
end
end | [
"def",
"each",
"Directory",
".",
"each",
"do",
"|",
"id",
"|",
"remote",
"=",
"NodeCache",
".",
"register",
"id",
"next",
"unless",
"remote",
"yield",
"remote",
"end",
"end"
] | Iterate across all available nodes | [
"Iterate",
"across",
"all",
"available",
"nodes"
] | a8fecfae220cb2c20d3761bc27880e4133aba498 | https://github.com/celluloid/dcell/blob/a8fecfae220cb2c20d3761bc27880e4133aba498/lib/dcell/node_manager.rb#L51-L57 |
22,933 | dicom/rtkit | lib/rtkit/cr_series.rb | RTKIT.CRSeries.add_image | def add_image(image)
raise ArgumentError, "Invalid argument 'image'. Expected Image, got #{image.class}." unless image.is_a?(Image)
@images << image
@associated_images[image.uid] = image
end | ruby | def add_image(image)
raise ArgumentError, "Invalid argument 'image'. Expected Image, got #{image.class}." unless image.is_a?(Image)
@images << image
@associated_images[image.uid] = image
end | [
"def",
"add_image",
"(",
"image",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'image'. Expected Image, got #{image.class}.\"",
"unless",
"image",
".",
"is_a?",
"(",
"Image",
")",
"@images",
"<<",
"image",
"@associated_images",
"[",
"image",
".",
"uid",
"]"... | Adds an Image to this CRSeries.
@param [Image] image an image instance to be associated with this series | [
"Adds",
"an",
"Image",
"to",
"this",
"CRSeries",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/cr_series.rb#L94-L98 |
22,934 | celluloid/dcell | lib/dcell.rb | DCell.ClassMethods.find | def find(actor)
Directory.each_with_object([]) do |id, actors|
next if id == DCell.id
node = Directory[id]
next unless node
next unless node.actors.include? actor
ractor = get_remote_actor actor, id
actors << ractor if ractor
end
end | ruby | def find(actor)
Directory.each_with_object([]) do |id, actors|
next if id == DCell.id
node = Directory[id]
next unless node
next unless node.actors.include? actor
ractor = get_remote_actor actor, id
actors << ractor if ractor
end
end | [
"def",
"find",
"(",
"actor",
")",
"Directory",
".",
"each_with_object",
"(",
"[",
"]",
")",
"do",
"|",
"id",
",",
"actors",
"|",
"next",
"if",
"id",
"==",
"DCell",
".",
"id",
"node",
"=",
"Directory",
"[",
"id",
"]",
"next",
"unless",
"node",
"next... | Returns actors from multiple nodes | [
"Returns",
"actors",
"from",
"multiple",
"nodes"
] | a8fecfae220cb2c20d3761bc27880e4133aba498 | https://github.com/celluloid/dcell/blob/a8fecfae220cb2c20d3761bc27880e4133aba498/lib/dcell.rb#L100-L109 |
22,935 | celluloid/dcell | lib/dcell.rb | DCell.ClassMethods.run! | def run!
Directory[id].actors = local_actors
Directory[id].pubkey = crypto ? crypto_keys[:pubkey] : nil
DCell::SupervisionGroup.run!
end | ruby | def run!
Directory[id].actors = local_actors
Directory[id].pubkey = crypto ? crypto_keys[:pubkey] : nil
DCell::SupervisionGroup.run!
end | [
"def",
"run!",
"Directory",
"[",
"id",
"]",
".",
"actors",
"=",
"local_actors",
"Directory",
"[",
"id",
"]",
".",
"pubkey",
"=",
"crypto",
"?",
"crypto_keys",
"[",
":pubkey",
"]",
":",
"nil",
"DCell",
"::",
"SupervisionGroup",
".",
"run!",
"end"
] | Run the DCell application in the background | [
"Run",
"the",
"DCell",
"application",
"in",
"the",
"background"
] | a8fecfae220cb2c20d3761bc27880e4133aba498 | https://github.com/celluloid/dcell/blob/a8fecfae220cb2c20d3761bc27880e4133aba498/lib/dcell.rb#L113-L117 |
22,936 | celluloid/dcell | lib/dcell.rb | DCell.ClassMethods.generate_node_id | def generate_node_id
# a little bit more creative
if @registry.respond_to? :unique
@registry.unique
else
digest = Digest::SHA512.new
seed = ::Socket.gethostname + rand.to_s + Time.now.to_s + SecureRandom.hex
digest.update(seed).to_s
end
end | ruby | def generate_node_id
# a little bit more creative
if @registry.respond_to? :unique
@registry.unique
else
digest = Digest::SHA512.new
seed = ::Socket.gethostname + rand.to_s + Time.now.to_s + SecureRandom.hex
digest.update(seed).to_s
end
end | [
"def",
"generate_node_id",
"# a little bit more creative",
"if",
"@registry",
".",
"respond_to?",
":unique",
"@registry",
".",
"unique",
"else",
"digest",
"=",
"Digest",
"::",
"SHA512",
".",
"new",
"seed",
"=",
"::",
"Socket",
".",
"gethostname",
"+",
"rand",
".... | Attempt to generate a unique node ID for this machine | [
"Attempt",
"to",
"generate",
"a",
"unique",
"node",
"ID",
"for",
"this",
"machine"
] | a8fecfae220cb2c20d3761bc27880e4133aba498 | https://github.com/celluloid/dcell/blob/a8fecfae220cb2c20d3761bc27880e4133aba498/lib/dcell.rb#L165-L174 |
22,937 | celluloid/dcell | lib/dcell/node.rb | DCell.Node.find | def find(name)
request = Message::Find.new(Thread.mailbox, name)
methods = send_request request
return nil if methods.is_a? NilClass
rsocket # open relay pipe to avoid race conditions
actor = DCell::ActorProxy.create.new self, name, methods
add_actor actor
end | ruby | def find(name)
request = Message::Find.new(Thread.mailbox, name)
methods = send_request request
return nil if methods.is_a? NilClass
rsocket # open relay pipe to avoid race conditions
actor = DCell::ActorProxy.create.new self, name, methods
add_actor actor
end | [
"def",
"find",
"(",
"name",
")",
"request",
"=",
"Message",
"::",
"Find",
".",
"new",
"(",
"Thread",
".",
"mailbox",
",",
"name",
")",
"methods",
"=",
"send_request",
"request",
"return",
"nil",
"if",
"methods",
".",
"is_a?",
"NilClass",
"rsocket",
"# op... | Find an call registered with a given name on this node | [
"Find",
"an",
"call",
"registered",
"with",
"a",
"given",
"name",
"on",
"this",
"node"
] | a8fecfae220cb2c20d3761bc27880e4133aba498 | https://github.com/celluloid/dcell/blob/a8fecfae220cb2c20d3761bc27880e4133aba498/lib/dcell/node.rb#L60-L67 |
22,938 | celluloid/dcell | lib/dcell/node.rb | DCell.Node.actors | def actors
request = Message::List.new(Thread.mailbox)
list = send_request request
list.map!(&:to_sym)
end | ruby | def actors
request = Message::List.new(Thread.mailbox)
list = send_request request
list.map!(&:to_sym)
end | [
"def",
"actors",
"request",
"=",
"Message",
"::",
"List",
".",
"new",
"(",
"Thread",
".",
"mailbox",
")",
"list",
"=",
"send_request",
"request",
"list",
".",
"map!",
"(",
":to_sym",
")",
"end"
] | List all registered actors on this node | [
"List",
"all",
"registered",
"actors",
"on",
"this",
"node"
] | a8fecfae220cb2c20d3761bc27880e4133aba498 | https://github.com/celluloid/dcell/blob/a8fecfae220cb2c20d3761bc27880e4133aba498/lib/dcell/node.rb#L71-L75 |
22,939 | celluloid/dcell | lib/dcell/node.rb | DCell.Node.ping | def ping(timeout=nil)
request = Message::Ping.new(Thread.mailbox)
send_request request, :request, timeout
end | ruby | def ping(timeout=nil)
request = Message::Ping.new(Thread.mailbox)
send_request request, :request, timeout
end | [
"def",
"ping",
"(",
"timeout",
"=",
"nil",
")",
"request",
"=",
"Message",
"::",
"Ping",
".",
"new",
"(",
"Thread",
".",
"mailbox",
")",
"send_request",
"request",
",",
":request",
",",
"timeout",
"end"
] | Send a ping message with a given timeout | [
"Send",
"a",
"ping",
"message",
"with",
"a",
"given",
"timeout"
] | a8fecfae220cb2c20d3761bc27880e4133aba498 | https://github.com/celluloid/dcell/blob/a8fecfae220cb2c20d3761bc27880e4133aba498/lib/dcell/node.rb#L79-L82 |
22,940 | celluloid/dcell | lib/dcell/node.rb | DCell.Node.shutdown | def shutdown
transition :shutdown
kill_actors
close_comm
NodeCache.delete @id
MailboxManager.delete Thread.mailbox
instance_variables.each { |iv| remove_instance_variable iv }
end | ruby | def shutdown
transition :shutdown
kill_actors
close_comm
NodeCache.delete @id
MailboxManager.delete Thread.mailbox
instance_variables.each { |iv| remove_instance_variable iv }
end | [
"def",
"shutdown",
"transition",
":shutdown",
"kill_actors",
"close_comm",
"NodeCache",
".",
"delete",
"@id",
"MailboxManager",
".",
"delete",
"Thread",
".",
"mailbox",
"instance_variables",
".",
"each",
"{",
"|",
"iv",
"|",
"remove_instance_variable",
"iv",
"}",
... | Graceful termination of the node | [
"Graceful",
"termination",
"of",
"the",
"node"
] | a8fecfae220cb2c20d3761bc27880e4133aba498 | https://github.com/celluloid/dcell/blob/a8fecfae220cb2c20d3761bc27880e4133aba498/lib/dcell/node.rb#L110-L117 |
22,941 | dicom/rtkit | lib/rtkit/slice.rb | RTKIT.Slice.add_contour | def add_contour(contour)
raise ArgumentError, "Invalid argument 'contour'. Expected Contour, got #{contour.class}." unless contour.is_a?(Contour)
@contours << contour unless @contours.include?(contour)
end | ruby | def add_contour(contour)
raise ArgumentError, "Invalid argument 'contour'. Expected Contour, got #{contour.class}." unless contour.is_a?(Contour)
@contours << contour unless @contours.include?(contour)
end | [
"def",
"add_contour",
"(",
"contour",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'contour'. Expected Contour, got #{contour.class}.\"",
"unless",
"contour",
".",
"is_a?",
"(",
"Contour",
")",
"@contours",
"<<",
"contour",
"unless",
"@contours",
".",
"include?... | Adds a Contour instance to this Slice.
@param [Contour] contour a contour instance to be associated with this slice | [
"Adds",
"a",
"Contour",
"instance",
"to",
"this",
"Slice",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/slice.rb#L83-L86 |
22,942 | dicom/rtkit | lib/rtkit/slice.rb | RTKIT.Slice.bin_image | def bin_image(source_image=@image)
raise "Referenced ROI Slice Image is missing from the dataset. Unable to construct image." unless @image
bin_img = BinImage.new(NArray.byte(source_image.columns, source_image.rows), source_image)
# Delineate and fill for each contour, then create the final image:
... | ruby | def bin_image(source_image=@image)
raise "Referenced ROI Slice Image is missing from the dataset. Unable to construct image." unless @image
bin_img = BinImage.new(NArray.byte(source_image.columns, source_image.rows), source_image)
# Delineate and fill for each contour, then create the final image:
... | [
"def",
"bin_image",
"(",
"source_image",
"=",
"@image",
")",
"raise",
"\"Referenced ROI Slice Image is missing from the dataset. Unable to construct image.\"",
"unless",
"@image",
"bin_img",
"=",
"BinImage",
".",
"new",
"(",
"NArray",
".",
"byte",
"(",
"source_image",
"."... | Creates a binary segmented image, from the contours defined for this
slice, applied to the referenced Image instance.
@param [Image] source_image the image on which the binary image will be applied (defaults to the referenced (anatomical) image, but may be e.g. a dose image)
@return [BinImage] the derived binary im... | [
"Creates",
"a",
"binary",
"segmented",
"image",
"from",
"the",
"contours",
"defined",
"for",
"this",
"slice",
"applied",
"to",
"the",
"referenced",
"Image",
"instance",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/slice.rb#L131-L140 |
22,943 | dicom/rtkit | lib/rtkit/slice.rb | RTKIT.Slice.plane | def plane
# Such a change is only possible if the Slice instance has a Contour with at least three Coordinates:
raise "This Slice does not contain a Contour. Plane determination is not possible." if @contours.length == 0
raise "This Slice does not contain a Contour with at least 3 Coordinates. Plane d... | ruby | def plane
# Such a change is only possible if the Slice instance has a Contour with at least three Coordinates:
raise "This Slice does not contain a Contour. Plane determination is not possible." if @contours.length == 0
raise "This Slice does not contain a Contour with at least 3 Coordinates. Plane d... | [
"def",
"plane",
"# Such a change is only possible if the Slice instance has a Contour with at least three Coordinates:",
"raise",
"\"This Slice does not contain a Contour. Plane determination is not possible.\"",
"if",
"@contours",
".",
"length",
"==",
"0",
"raise",
"\"This Slice does not co... | Gives a Plane corresponding to this Slice geometry. The plane is
calculated from coordinates belonging to this instance.
@return [Plane] the derived plane
@raise [RuntimeError] unless the required number of coordinates are present (at least 3) | [
"Gives",
"a",
"Plane",
"corresponding",
"to",
"this",
"Slice",
"geometry",
".",
"The",
"plane",
"is",
"calculated",
"from",
"coordinates",
"belonging",
"to",
"this",
"instance",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/slice.rb#L166-L177 |
22,944 | dicom/rtkit | lib/rtkit/structure.rb | RTKIT.Structure.ss_item | def ss_item
item = DICOM::Item.new
item.add(DICOM::Element.new(ROI_NUMBER, @number.to_s))
item.add(DICOM::Element.new(REF_FRAME_OF_REF, @frame.uid))
item.add(DICOM::Element.new(ROI_NAME, @name))
item.add(DICOM::Element.new(ROI_ALGORITHM, @algorithm))
return item
end | ruby | def ss_item
item = DICOM::Item.new
item.add(DICOM::Element.new(ROI_NUMBER, @number.to_s))
item.add(DICOM::Element.new(REF_FRAME_OF_REF, @frame.uid))
item.add(DICOM::Element.new(ROI_NAME, @name))
item.add(DICOM::Element.new(ROI_ALGORITHM, @algorithm))
return item
end | [
"def",
"ss_item",
"item",
"=",
"DICOM",
"::",
"Item",
".",
"new",
"item",
".",
"add",
"(",
"DICOM",
"::",
"Element",
".",
"new",
"(",
"ROI_NUMBER",
",",
"@number",
".",
"to_s",
")",
")",
"item",
".",
"add",
"(",
"DICOM",
"::",
"Element",
".",
"new"... | Creates a Structure Set ROI Sequence Item from the attributes of the Structure instance.
@return [DICOM::Item] a structure set ROI sequence item | [
"Creates",
"a",
"Structure",
"Set",
"ROI",
"Sequence",
"Item",
"from",
"the",
"attributes",
"of",
"the",
"Structure",
"instance",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/structure.rb#L268-L275 |
22,945 | dicom/rtkit | lib/rtkit/patient.rb | RTKIT.Patient.add | def add(dcm)
s = study(dcm.value(STUDY_UID))
if s
s.add(dcm)
else
add_study(Study.load(dcm, self))
end
end | ruby | def add(dcm)
s = study(dcm.value(STUDY_UID))
if s
s.add(dcm)
else
add_study(Study.load(dcm, self))
end
end | [
"def",
"add",
"(",
"dcm",
")",
"s",
"=",
"study",
"(",
"dcm",
".",
"value",
"(",
"STUDY_UID",
")",
")",
"if",
"s",
"s",
".",
"add",
"(",
"dcm",
")",
"else",
"add_study",
"(",
"Study",
".",
"load",
"(",
"dcm",
",",
"self",
")",
")",
"end",
"en... | Registers a DICOM object to the patient, by adding it to an existing
Study, or creating a new Study.
@param [DICOM::DObject] dcm a DICOM object | [
"Registers",
"a",
"DICOM",
"object",
"to",
"the",
"patient",
"by",
"adding",
"it",
"to",
"an",
"existing",
"Study",
"or",
"creating",
"a",
"new",
"Study",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/patient.rb#L99-L106 |
22,946 | dicom/rtkit | lib/rtkit/patient.rb | RTKIT.Patient.add_study | def add_study(study)
raise ArgumentError, "Invalid argument 'study'. Expected Study, got #{study.class}." unless study.is_a?(Study)
# Do not add it again if the study already belongs to this instance:
@studies << study unless @associated_studies[study.uid]
@associated_studies[study.uid] = study
... | ruby | def add_study(study)
raise ArgumentError, "Invalid argument 'study'. Expected Study, got #{study.class}." unless study.is_a?(Study)
# Do not add it again if the study already belongs to this instance:
@studies << study unless @associated_studies[study.uid]
@associated_studies[study.uid] = study
... | [
"def",
"add_study",
"(",
"study",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'study'. Expected Study, got #{study.class}.\"",
"unless",
"study",
".",
"is_a?",
"(",
"Study",
")",
"# Do not add it again if the study already belongs to this instance:",
"@studies",
"<<",... | Adds a Study to this Patient.
@param [Study] study a study instance to be associated with this patient | [
"Adds",
"a",
"Study",
"to",
"this",
"Patient",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/patient.rb#L123-L128 |
22,947 | slagyr/limelight | ruby/lib/limelight/prop.rb | Limelight.Prop.play_sound | def play_sound(filename)
path = Java::limelight.Context.fs.path_to(scene.path, filename)
@peer.play_sound(path)
end | ruby | def play_sound(filename)
path = Java::limelight.Context.fs.path_to(scene.path, filename)
@peer.play_sound(path)
end | [
"def",
"play_sound",
"(",
"filename",
")",
"path",
"=",
"Java",
"::",
"limelight",
".",
"Context",
".",
"fs",
".",
"path_to",
"(",
"scene",
".",
"path",
",",
"filename",
")",
"@peer",
".",
"play_sound",
"(",
"path",
")",
"end"
] | Plays a sound on the computers audio output. The parameter is the filename of a .au sound file.
This filename should relative to the root directory of the current Production, or an absolute path. | [
"Plays",
"a",
"sound",
"on",
"the",
"computers",
"audio",
"output",
".",
"The",
"parameter",
"is",
"the",
"filename",
"of",
"a",
".",
"au",
"sound",
"file",
".",
"This",
"filename",
"should",
"relative",
"to",
"the",
"root",
"directory",
"of",
"the",
"cu... | 2e8db684771587422d55a9329e895481e9b56a26 | https://github.com/slagyr/limelight/blob/2e8db684771587422d55a9329e895481e9b56a26/ruby/lib/limelight/prop.rb#L260-L263 |
22,948 | slagyr/limelight | ruby/lib/limelight/scene.rb | Limelight.Scene.open_production | def open_production(production_path)
Thread.new { Java::limelight.Context.instance.studio.open(production_path) }
end | ruby | def open_production(production_path)
Thread.new { Java::limelight.Context.instance.studio.open(production_path) }
end | [
"def",
"open_production",
"(",
"production_path",
")",
"Thread",
".",
"new",
"{",
"Java",
"::",
"limelight",
".",
"Context",
".",
"instance",
".",
"studio",
".",
"open",
"(",
"production_path",
")",
"}",
"end"
] | Creates a new Producer to open the specified Production. | [
"Creates",
"a",
"new",
"Producer",
"to",
"open",
"the",
"specified",
"Production",
"."
] | 2e8db684771587422d55a9329e895481e9b56a26 | https://github.com/slagyr/limelight/blob/2e8db684771587422d55a9329e895481e9b56a26/ruby/lib/limelight/scene.rb#L96-L98 |
22,949 | slagyr/limelight | ruby/lib/limelight/scene.rb | Limelight.Scene.find_by_id | def find_by_id(id)
peer_result = @peer.find(id.to_s)
peer_result.nil? ? nil : peer_result.proxy
end | ruby | def find_by_id(id)
peer_result = @peer.find(id.to_s)
peer_result.nil? ? nil : peer_result.proxy
end | [
"def",
"find_by_id",
"(",
"id",
")",
"peer_result",
"=",
"@peer",
".",
"find",
"(",
"id",
".",
"to_s",
")",
"peer_result",
".",
"nil?",
"?",
"nil",
":",
"peer_result",
".",
"proxy",
"end"
] | Returns a Prop with the specified id. Returns nil id the Prop doesn't exist in the Scene. | [
"Returns",
"a",
"Prop",
"with",
"the",
"specified",
"id",
".",
"Returns",
"nil",
"id",
"the",
"Prop",
"doesn",
"t",
"exist",
"in",
"the",
"Scene",
"."
] | 2e8db684771587422d55a9329e895481e9b56a26 | https://github.com/slagyr/limelight/blob/2e8db684771587422d55a9329e895481e9b56a26/ruby/lib/limelight/scene.rb#L109-L112 |
22,950 | dicom/rtkit | lib/rtkit/collimator_setup.rb | RTKIT.CollimatorSetup.to_item | def to_item
item = DICOM::Item.new
item.add(DICOM::Element.new(COLL_TYPE, @type))
item.add(DICOM::Element.new(COLL_POS, positions_string))
return item
end | ruby | def to_item
item = DICOM::Item.new
item.add(DICOM::Element.new(COLL_TYPE, @type))
item.add(DICOM::Element.new(COLL_POS, positions_string))
return item
end | [
"def",
"to_item",
"item",
"=",
"DICOM",
"::",
"Item",
".",
"new",
"item",
".",
"add",
"(",
"DICOM",
"::",
"Element",
".",
"new",
"(",
"COLL_TYPE",
",",
"@type",
")",
")",
"item",
".",
"add",
"(",
"DICOM",
"::",
"Element",
".",
"new",
"(",
"COLL_POS... | Creates a Beam Limiting Device Position Sequence Item
from the attributes of the CollimatorSetup.
@return [DICOM::Item] the created DICOM item | [
"Creates",
"a",
"Beam",
"Limiting",
"Device",
"Position",
"Sequence",
"Item",
"from",
"the",
"attributes",
"of",
"the",
"CollimatorSetup",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/collimator_setup.rb#L113-L118 |
22,951 | dicom/rtkit | lib/rtkit/roi.rb | RTKIT.ROI.add_slice | def add_slice(slice)
raise ArgumentError, "Invalid argument 'slice'. Expected Slice, got #{slice.class}." unless slice.is_a?(Slice)
@slices << slice unless @associated_instance_uids[slice.uid]
@associated_instance_uids[slice.uid] = slice
end | ruby | def add_slice(slice)
raise ArgumentError, "Invalid argument 'slice'. Expected Slice, got #{slice.class}." unless slice.is_a?(Slice)
@slices << slice unless @associated_instance_uids[slice.uid]
@associated_instance_uids[slice.uid] = slice
end | [
"def",
"add_slice",
"(",
"slice",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'slice'. Expected Slice, got #{slice.class}.\"",
"unless",
"slice",
".",
"is_a?",
"(",
"Slice",
")",
"@slices",
"<<",
"slice",
"unless",
"@associated_instance_uids",
"[",
"slice",
... | Adds a Slice instance to this ROI.
@param [Slice] slice a slice instance to be associated with this ROI | [
"Adds",
"a",
"Slice",
"instance",
"to",
"this",
"ROI",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/roi.rb#L65-L69 |
22,952 | dicom/rtkit | lib/rtkit/roi.rb | RTKIT.ROI.create_slices | def create_slices(contour_sequence)
raise ArgumentError, "Invalid argument 'contour_sequence'. Expected DICOM::Sequence, got #{contour_sequence.class}." unless contour_sequence.is_a?(DICOM::Sequence)
# Sort the contours by slices:
slice_collection = Hash.new
contour_sequence.each do |slice_conto... | ruby | def create_slices(contour_sequence)
raise ArgumentError, "Invalid argument 'contour_sequence'. Expected DICOM::Sequence, got #{contour_sequence.class}." unless contour_sequence.is_a?(DICOM::Sequence)
# Sort the contours by slices:
slice_collection = Hash.new
contour_sequence.each do |slice_conto... | [
"def",
"create_slices",
"(",
"contour_sequence",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'contour_sequence'. Expected DICOM::Sequence, got #{contour_sequence.class}.\"",
"unless",
"contour_sequence",
".",
"is_a?",
"(",
"DICOM",
"::",
"Sequence",
")",
"# Sort the c... | Creates Slice instances from the contour sequence items of the contour
sequence, and connects these slices to this ROI instance.
@param [DICOM::Sequence] contour_sequence a Contour Sequence | [
"Creates",
"Slice",
"instances",
"from",
"the",
"contour",
"sequence",
"items",
"of",
"the",
"contour",
"sequence",
"and",
"connects",
"these",
"slices",
"to",
"this",
"ROI",
"instance",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/roi.rb#L143-L156 |
22,953 | dicom/rtkit | lib/rtkit/roi.rb | RTKIT.ROI.distribution | def distribution(dose_volume=@struct.plan.rt_dose.sum)
raise ArgumentError, "Invalid argument 'dose_volume'. Expected DoseVolume, got #{dose_volume.class}." unless dose_volume.is_a?(DoseVolume)
raise ArgumentError, "Invalid argument 'dose_volume'. The specified DoseVolume does not belong to this ROI's Struc... | ruby | def distribution(dose_volume=@struct.plan.rt_dose.sum)
raise ArgumentError, "Invalid argument 'dose_volume'. Expected DoseVolume, got #{dose_volume.class}." unless dose_volume.is_a?(DoseVolume)
raise ArgumentError, "Invalid argument 'dose_volume'. The specified DoseVolume does not belong to this ROI's Struc... | [
"def",
"distribution",
"(",
"dose_volume",
"=",
"@struct",
".",
"plan",
".",
"rt_dose",
".",
"sum",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'dose_volume'. Expected DoseVolume, got #{dose_volume.class}.\"",
"unless",
"dose_volume",
".",
"is_a?",
"(",
"DoseV... | Creates a DoseDistribution based on the delineation by this ROI in the
specified RTDose series.
@param [DoseVolume] dose_volume the dose volume to extract the dose distribution from (defaults to the sum of the dose volumes of the first RTDose of the first plan of the parent StructureSet)
@raise [ArgumentError] if g... | [
"Creates",
"a",
"DoseDistribution",
"based",
"on",
"the",
"delineation",
"by",
"this",
"ROI",
"in",
"the",
"specified",
"RTDose",
"series",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/roi.rb#L164-L172 |
22,954 | dicom/rtkit | lib/rtkit/roi.rb | RTKIT.ROI.translate | def translate(x, y, z)
@slices.each do |s|
s.translate(x, y, z)
end
end | ruby | def translate(x, y, z)
@slices.each do |s|
s.translate(x, y, z)
end
end | [
"def",
"translate",
"(",
"x",
",",
"y",
",",
"z",
")",
"@slices",
".",
"each",
"do",
"|",
"s",
"|",
"s",
".",
"translate",
"(",
"x",
",",
"y",
",",
"z",
")",
"end",
"end"
] | Moves the ROI by applying the given offset vector to its coordinates.
@param [Float] x the offset along the x axis (in units of mm)
@param [Float] y the offset along the y axis (in units of mm)
@param [Float] z the offset along the z axis (in units of mm) | [
"Moves",
"the",
"ROI",
"by",
"applying",
"the",
"given",
"offset",
"vector",
"to",
"its",
"coordinates",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/roi.rb#L314-L318 |
22,955 | slagyr/limelight | ruby/lib/limelight/pen.rb | Limelight.Pen.smooth= | def smooth=(value)
hint = value ? java.awt.RenderingHints::VALUE_ANTIALIAS_ON : java.awt.RenderingHints::VALUE_ANTIALIAS_OFF
@context.setRenderingHint(java.awt.RenderingHints::KEY_ANTIALIASING, hint)
end | ruby | def smooth=(value)
hint = value ? java.awt.RenderingHints::VALUE_ANTIALIAS_ON : java.awt.RenderingHints::VALUE_ANTIALIAS_OFF
@context.setRenderingHint(java.awt.RenderingHints::KEY_ANTIALIASING, hint)
end | [
"def",
"smooth",
"=",
"(",
"value",
")",
"hint",
"=",
"value",
"?",
"java",
".",
"awt",
".",
"RenderingHints",
"::",
"VALUE_ANTIALIAS_ON",
":",
"java",
".",
"awt",
".",
"RenderingHints",
"::",
"VALUE_ANTIALIAS_OFF",
"@context",
".",
"setRenderingHint",
"(",
... | Specifies whether the pen will use anti-aliasing to draw smooth shapes or not. Shapes will appear pixilated when
smooth is set to false. | [
"Specifies",
"whether",
"the",
"pen",
"will",
"use",
"anti",
"-",
"aliasing",
"to",
"draw",
"smooth",
"shapes",
"or",
"not",
".",
"Shapes",
"will",
"appear",
"pixilated",
"when",
"smooth",
"is",
"set",
"to",
"false",
"."
] | 2e8db684771587422d55a9329e895481e9b56a26 | https://github.com/slagyr/limelight/blob/2e8db684771587422d55a9329e895481e9b56a26/ruby/lib/limelight/pen.rb#L45-L48 |
22,956 | slagyr/limelight | ruby/lib/limelight/pen.rb | Limelight.Pen.fill_oval | def fill_oval(x, y, width, height)
@context.fillOval(x, y, width, height)
end | ruby | def fill_oval(x, y, width, height)
@context.fillOval(x, y, width, height)
end | [
"def",
"fill_oval",
"(",
"x",
",",
"y",
",",
"width",
",",
"height",
")",
"@context",
".",
"fillOval",
"(",
"x",
",",
"y",
",",
"width",
",",
"height",
")",
"end"
] | Fills an oval specified by the bounding rectangle. See draw_oval. | [
"Fills",
"an",
"oval",
"specified",
"by",
"the",
"bounding",
"rectangle",
".",
"See",
"draw_oval",
"."
] | 2e8db684771587422d55a9329e895481e9b56a26 | https://github.com/slagyr/limelight/blob/2e8db684771587422d55a9329e895481e9b56a26/ruby/lib/limelight/pen.rb#L77-L79 |
22,957 | dicom/rtkit | lib/rtkit/image.rb | RTKIT.Image.draw_lines | def draw_lines(column_indices, row_indices, image, value)
raise ArgumentError, "Invalid argument 'column_indices'. Expected Array, got #{column_indices.class}." unless column_indices.is_a?(Array)
raise ArgumentError, "Invalid argument 'row_indices'. Expected Array, got #{row_indices.class}." unless row_indi... | ruby | def draw_lines(column_indices, row_indices, image, value)
raise ArgumentError, "Invalid argument 'column_indices'. Expected Array, got #{column_indices.class}." unless column_indices.is_a?(Array)
raise ArgumentError, "Invalid argument 'row_indices'. Expected Array, got #{row_indices.class}." unless row_indi... | [
"def",
"draw_lines",
"(",
"column_indices",
",",
"row_indices",
",",
"image",
",",
"value",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'column_indices'. Expected Array, got #{column_indices.class}.\"",
"unless",
"column_indices",
".",
"is_a?",
"(",
"Array",
")"... | Fills the provided pixel array with lines of a specified value, based on
two vectors of column and row indices.
@param [Array] column_indices an array (vector) of pixel column indices
@param [Array] row_indices an array (vector) of pixel row indices
@param [NArray] image a two-dimensional numerical pixel array
@p... | [
"Fills",
"the",
"provided",
"pixel",
"array",
"with",
"lines",
"of",
"a",
"specified",
"value",
"based",
"on",
"two",
"vectors",
"of",
"column",
"and",
"row",
"indices",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/image.rb#L175-L186 |
22,958 | dicom/rtkit | lib/rtkit/image.rb | RTKIT.Image.extract_pixels | def extract_pixels(x_coords, y_coords, z_coords)
# FIXME: This method (along with some other methods in this class, doesn't
# actually work for a pure Image instance. This should probably be
# refactored (mix-in module instead more appropriate?)
# Get image indices (nearest neighbour):
col... | ruby | def extract_pixels(x_coords, y_coords, z_coords)
# FIXME: This method (along with some other methods in this class, doesn't
# actually work for a pure Image instance. This should probably be
# refactored (mix-in module instead more appropriate?)
# Get image indices (nearest neighbour):
col... | [
"def",
"extract_pixels",
"(",
"x_coords",
",",
"y_coords",
",",
"z_coords",
")",
"# FIXME: This method (along with some other methods in this class, doesn't",
"# actually work for a pure Image instance. This should probably be",
"# refactored (mix-in module instead more appropriate?)",
"# Ge... | Extracts pixels based on cartesian coordinate arrays.
@note No interpolation is performed in the case of a given coordinate
being located between pixel indices. In these cases a basic nearest
neighbour algorithm is used.
@param [NArray] x_coords a numerical array (vector) of pixel x coordinates
@param [NArra... | [
"Extracts",
"pixels",
"based",
"on",
"cartesian",
"coordinate",
"arrays",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/image.rb#L199-L209 |
22,959 | dicom/rtkit | lib/rtkit/image.rb | RTKIT.Image.flood_fill | def flood_fill(col, row, image, fill_value)
# If the given starting point is out of bounds, put it at the array boundary:
col = col > image.shape[0] ? -1 : col
row = row > image.shape[1] ? -1 : row
existing_value = image[col, row]
queue = Array.new
queue.push([col, row])
until ... | ruby | def flood_fill(col, row, image, fill_value)
# If the given starting point is out of bounds, put it at the array boundary:
col = col > image.shape[0] ? -1 : col
row = row > image.shape[1] ? -1 : row
existing_value = image[col, row]
queue = Array.new
queue.push([col, row])
until ... | [
"def",
"flood_fill",
"(",
"col",
",",
"row",
",",
"image",
",",
"fill_value",
")",
"# If the given starting point is out of bounds, put it at the array boundary:",
"col",
"=",
"col",
">",
"image",
".",
"shape",
"[",
"0",
"]",
"?",
"-",
"1",
":",
"col",
"row",
... | Replaces all pixels of a specific value that are contained by pixels of
a different value.
Uses an iterative, queue based flood fill algorithm. It seems that a
recursive method is not suited for Ruby, due to its limited stack space
(which is known to be a problem in general for scripting languages).
@param [Inte... | [
"Replaces",
"all",
"pixels",
"of",
"a",
"specific",
"value",
"that",
"are",
"contained",
"by",
"pixels",
"of",
"a",
"different",
"value",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/image.rb#L224-L253 |
22,960 | dicom/rtkit | lib/rtkit/image.rb | RTKIT.Image.print_img | def print_img(narr=@narray)
puts "Image dimensions: #{@columns}*#{@rows}"
narr.shape[0].times do |i|
puts narr[true, i].to_a.to_s
end
end | ruby | def print_img(narr=@narray)
puts "Image dimensions: #{@columns}*#{@rows}"
narr.shape[0].times do |i|
puts narr[true, i].to_a.to_s
end
end | [
"def",
"print_img",
"(",
"narr",
"=",
"@narray",
")",
"puts",
"\"Image dimensions: #{@columns}*#{@rows}\"",
"narr",
".",
"shape",
"[",
"0",
"]",
".",
"times",
"do",
"|",
"i",
"|",
"puts",
"narr",
"[",
"true",
",",
"i",
"]",
".",
"to_a",
".",
"to_s",
"e... | A convenience method for printing image information.
@deprecated NB! This has been used only for debugging, and will soon be removed.
@param [NArray] narr a numerical array | [
"A",
"convenience",
"method",
"for",
"printing",
"image",
"information",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/image.rb#L368-L373 |
22,961 | dicom/rtkit | lib/rtkit/image.rb | RTKIT.Image.create_general_dicom_image_scaffold | def create_general_dicom_image_scaffold
# Some tags are created/updated only if no DICOM object already exists:
unless @dcm
@dcm = DICOM::DObject.new
# Group 0008:
@dcm.add_element(SPECIFIC_CHARACTER_SET, 'ISO_IR 100')
@dcm.add_element(IMAGE_TYPE, 'DERIVED\SECONDARY\DRR')
... | ruby | def create_general_dicom_image_scaffold
# Some tags are created/updated only if no DICOM object already exists:
unless @dcm
@dcm = DICOM::DObject.new
# Group 0008:
@dcm.add_element(SPECIFIC_CHARACTER_SET, 'ISO_IR 100')
@dcm.add_element(IMAGE_TYPE, 'DERIVED\SECONDARY\DRR')
... | [
"def",
"create_general_dicom_image_scaffold",
"# Some tags are created/updated only if no DICOM object already exists:",
"unless",
"@dcm",
"@dcm",
"=",
"DICOM",
"::",
"DObject",
".",
"new",
"# Group 0008:",
"@dcm",
".",
"add_element",
"(",
"SPECIFIC_CHARACTER_SET",
",",
"'ISO_I... | Creates a new DICOM object with a set of basic attributes needed
for a valid DICOM image file. | [
"Creates",
"a",
"new",
"DICOM",
"object",
"with",
"a",
"set",
"of",
"basic",
"attributes",
"needed",
"for",
"a",
"valid",
"DICOM",
"image",
"file",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/image.rb#L500-L527 |
22,962 | dicom/rtkit | lib/rtkit/image.rb | RTKIT.Image.update_dicom_image | def update_dicom_image
# General image attributes:
@dcm.add_element(IMAGE_DATE, @date)
@dcm.add_element(IMAGE_TIME, @time)
@dcm.add_element(SOP_UID, @uid)
@dcm.add_element(COLUMNS, @columns)
@dcm.add_element(ROWS, @rows)
# Pixel data:
@dcm.pixels = @narray
# Higher ... | ruby | def update_dicom_image
# General image attributes:
@dcm.add_element(IMAGE_DATE, @date)
@dcm.add_element(IMAGE_TIME, @time)
@dcm.add_element(SOP_UID, @uid)
@dcm.add_element(COLUMNS, @columns)
@dcm.add_element(ROWS, @rows)
# Pixel data:
@dcm.pixels = @narray
# Higher ... | [
"def",
"update_dicom_image",
"# General image attributes:",
"@dcm",
".",
"add_element",
"(",
"IMAGE_DATE",
",",
"@date",
")",
"@dcm",
".",
"add_element",
"(",
"IMAGE_TIME",
",",
"@time",
")",
"@dcm",
".",
"add_element",
"(",
"SOP_UID",
",",
"@uid",
")",
"@dcm",
... | Creates a new DICOM object with a set of basic attributes needed
for a valid DICOM file of slice type image modality. | [
"Creates",
"a",
"new",
"DICOM",
"object",
"with",
"a",
"set",
"of",
"basic",
"attributes",
"needed",
"for",
"a",
"valid",
"DICOM",
"file",
"of",
"slice",
"type",
"image",
"modality",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/image.rb#L641-L653 |
22,963 | dicom/rtkit | lib/rtkit/rt_dose.rb | RTKIT.RTDose.add_volume | def add_volume(volume)
raise ArgumentError, "Invalid argument 'volume'. Expected DoseVolume, got #{volume.class}." unless volume.is_a?(DoseVolume)
@volumes << volume unless @associated_volumes[volume.uid]
@associated_volumes[volume.uid] = volume
end | ruby | def add_volume(volume)
raise ArgumentError, "Invalid argument 'volume'. Expected DoseVolume, got #{volume.class}." unless volume.is_a?(DoseVolume)
@volumes << volume unless @associated_volumes[volume.uid]
@associated_volumes[volume.uid] = volume
end | [
"def",
"add_volume",
"(",
"volume",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'volume'. Expected DoseVolume, got #{volume.class}.\"",
"unless",
"volume",
".",
"is_a?",
"(",
"DoseVolume",
")",
"@volumes",
"<<",
"volume",
"unless",
"@associated_volumes",
"[",
... | Adds a DoseVolume instance to this RTDose series.
@param [DoseVolume] volume a dose volume instance to be associated with this RTDose | [
"Adds",
"a",
"DoseVolume",
"instance",
"to",
"this",
"RTDose",
"series",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/rt_dose.rb#L141-L145 |
22,964 | dicom/rtkit | lib/rtkit/plan.rb | RTKIT.Plan.add_beam | def add_beam(beam)
raise ArgumentError, "Invalid argument 'beam'. Expected Beam, got #{beam.class}." unless beam.is_a?(Beam)
@beams << beam unless @beams.include?(beam)
end | ruby | def add_beam(beam)
raise ArgumentError, "Invalid argument 'beam'. Expected Beam, got #{beam.class}." unless beam.is_a?(Beam)
@beams << beam unless @beams.include?(beam)
end | [
"def",
"add_beam",
"(",
"beam",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'beam'. Expected Beam, got #{beam.class}.\"",
"unless",
"beam",
".",
"is_a?",
"(",
"Beam",
")",
"@beams",
"<<",
"beam",
"unless",
"@beams",
".",
"include?",
"(",
"beam",
")",
"... | Adds a Beam to this Plan.
@param [Beam] beam a beam instance to be associated with this plan | [
"Adds",
"a",
"Beam",
"to",
"this",
"Plan",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/plan.rb#L167-L170 |
22,965 | dicom/rtkit | lib/rtkit/plan.rb | RTKIT.Plan.add_rt_dose | def add_rt_dose(rt_dose)
raise ArgumentError, "Invalid argument 'rt_dose'. Expected RTDose, got #{rt_dose.class}." unless rt_dose.is_a?(RTDose)
@rt_doses << rt_dose unless @associated_rt_doses[rt_dose.uid]
@associated_rt_doses[rt_dose.uid] = rt_dose
end | ruby | def add_rt_dose(rt_dose)
raise ArgumentError, "Invalid argument 'rt_dose'. Expected RTDose, got #{rt_dose.class}." unless rt_dose.is_a?(RTDose)
@rt_doses << rt_dose unless @associated_rt_doses[rt_dose.uid]
@associated_rt_doses[rt_dose.uid] = rt_dose
end | [
"def",
"add_rt_dose",
"(",
"rt_dose",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'rt_dose'. Expected RTDose, got #{rt_dose.class}.\"",
"unless",
"rt_dose",
".",
"is_a?",
"(",
"RTDose",
")",
"@rt_doses",
"<<",
"rt_dose",
"unless",
"@associated_rt_doses",
"[",
... | Adds a RTDose series to this Plan.
@param [RTDose] rt_dose an RTDose instance to be associated with this plan | [
"Adds",
"a",
"RTDose",
"series",
"to",
"this",
"Plan",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/plan.rb#L176-L180 |
22,966 | dicom/rtkit | lib/rtkit/plan.rb | RTKIT.Plan.add_rt_image | def add_rt_image(rt_image)
raise ArgumentError, "Invalid argument 'rt_image'. Expected RTImage, got #{rt_image.class}." unless rt_image.is_a?(RTImage)
@rt_images << rt_image unless @rt_images.include?(rt_image)
end | ruby | def add_rt_image(rt_image)
raise ArgumentError, "Invalid argument 'rt_image'. Expected RTImage, got #{rt_image.class}." unless rt_image.is_a?(RTImage)
@rt_images << rt_image unless @rt_images.include?(rt_image)
end | [
"def",
"add_rt_image",
"(",
"rt_image",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'rt_image'. Expected RTImage, got #{rt_image.class}.\"",
"unless",
"rt_image",
".",
"is_a?",
"(",
"RTImage",
")",
"@rt_images",
"<<",
"rt_image",
"unless",
"@rt_images",
".",
"... | Adds a RTImage Series to this Plan.
@param [RTImage] rt_image an RTImage instance to be associated with this plan | [
"Adds",
"a",
"RTImage",
"Series",
"to",
"this",
"Plan",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/plan.rb#L186-L189 |
22,967 | dicom/rtkit | lib/rtkit/beam.rb | RTKIT.Beam.add_collimator | def add_collimator(coll)
raise ArgumentError, "Invalid argument 'coll'. Expected Collimator, got #{coll.class}." unless coll.is_a?(Collimator)
@collimators << coll unless @associated_collimators[coll.type]
@associated_collimators[coll.type] = coll
end | ruby | def add_collimator(coll)
raise ArgumentError, "Invalid argument 'coll'. Expected Collimator, got #{coll.class}." unless coll.is_a?(Collimator)
@collimators << coll unless @associated_collimators[coll.type]
@associated_collimators[coll.type] = coll
end | [
"def",
"add_collimator",
"(",
"coll",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'coll'. Expected Collimator, got #{coll.class}.\"",
"unless",
"coll",
".",
"is_a?",
"(",
"Collimator",
")",
"@collimators",
"<<",
"coll",
"unless",
"@associated_collimators",
"[",
... | Adds a Collimator instance to this Beam.
@param [Collimator] coll a collimator instance to be associated with this beam | [
"Adds",
"a",
"Collimator",
"instance",
"to",
"this",
"Beam",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/beam.rb#L136-L140 |
22,968 | dicom/rtkit | lib/rtkit/beam.rb | RTKIT.Beam.add_control_point | def add_control_point(cp)
raise ArgumentError, "Invalid argument 'cp'. Expected ControlPoint, got #{cp.class}." unless cp.is_a?(ControlPoint)
@control_points << cp unless @associated_control_points[cp]
@associated_control_points[cp] = true
end | ruby | def add_control_point(cp)
raise ArgumentError, "Invalid argument 'cp'. Expected ControlPoint, got #{cp.class}." unless cp.is_a?(ControlPoint)
@control_points << cp unless @associated_control_points[cp]
@associated_control_points[cp] = true
end | [
"def",
"add_control_point",
"(",
"cp",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'cp'. Expected ControlPoint, got #{cp.class}.\"",
"unless",
"cp",
".",
"is_a?",
"(",
"ControlPoint",
")",
"@control_points",
"<<",
"cp",
"unless",
"@associated_control_points",
"[... | Adds a ControlPoint instance to this Beam.
@param [ControlPoint] cp a control point instance to be associated with this beam | [
"Adds",
"a",
"ControlPoint",
"instance",
"to",
"this",
"Beam",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/beam.rb#L146-L150 |
22,969 | dicom/rtkit | lib/rtkit/beam.rb | RTKIT.Beam.beam_item | def beam_item
item = DICOM::Item.new
item.add(DICOM::Element.new(ROI_COLOR, @color))
s = DICOM::Sequence.new(CONTOUR_SQ)
item.add(s)
item.add(DICOM::Element.new(REF_ROI_NUMBER, @number.to_s))
# Add Contour items to the Contour Sequence (one or several items per Slice):
@slices.... | ruby | def beam_item
item = DICOM::Item.new
item.add(DICOM::Element.new(ROI_COLOR, @color))
s = DICOM::Sequence.new(CONTOUR_SQ)
item.add(s)
item.add(DICOM::Element.new(REF_ROI_NUMBER, @number.to_s))
# Add Contour items to the Contour Sequence (one or several items per Slice):
@slices.... | [
"def",
"beam_item",
"item",
"=",
"DICOM",
"::",
"Item",
".",
"new",
"item",
".",
"add",
"(",
"DICOM",
"::",
"Element",
".",
"new",
"(",
"ROI_COLOR",
",",
"@color",
")",
")",
"s",
"=",
"DICOM",
"::",
"Sequence",
".",
"new",
"(",
"CONTOUR_SQ",
")",
"... | Creates a Beam Sequence Item from the attributes of the Beam instance.
@return [DICOM::Item] a beam sequence item | [
"Creates",
"a",
"Beam",
"Sequence",
"Item",
"from",
"the",
"attributes",
"of",
"the",
"Beam",
"instance",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/beam.rb#L156-L169 |
22,970 | dicom/rtkit | lib/rtkit/beam.rb | RTKIT.Beam.control_point | def control_point(*args)
raise ArgumentError, "Expected one or none arguments, got #{args.length}." unless [0, 1].include?(args.length)
if args.length == 1
raise ArgumentError, "Invalid argument 'index'. Expected Integer (or nil), got #{args.first.class}." unless [Integer, NilClass].include?(args.fi... | ruby | def control_point(*args)
raise ArgumentError, "Expected one or none arguments, got #{args.length}." unless [0, 1].include?(args.length)
if args.length == 1
raise ArgumentError, "Invalid argument 'index'. Expected Integer (or nil), got #{args.first.class}." unless [Integer, NilClass].include?(args.fi... | [
"def",
"control_point",
"(",
"*",
"args",
")",
"raise",
"ArgumentError",
",",
"\"Expected one or none arguments, got #{args.length}.\"",
"unless",
"[",
"0",
",",
"1",
"]",
".",
"include?",
"(",
"args",
".",
"length",
")",
"if",
"args",
".",
"length",
"==",
"1"... | Gives the ControlPoint instance mathcing the specified index.
@overload control_point(index)
@param [String] index the control_point index
@return [ControlPoint, NilClass] the matched control_point (or nil if no control_point is matched)
@overload control_point
@return [ControlPoint, NilClass] the first con... | [
"Gives",
"the",
"ControlPoint",
"instance",
"mathcing",
"the",
"specified",
"index",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/beam.rb#L197-L206 |
22,971 | dicom/rtkit | lib/rtkit/beam.rb | RTKIT.Beam.ref_beam_item | def ref_beam_item
item = DICOM::Item.new
item.add(DICOM::Element.new(OBS_NUMBER, @number.to_s))
item.add(DICOM::Element.new(REF_ROI_NUMBER, @number.to_s))
item.add(DICOM::Element.new(ROI_TYPE, @type))
item.add(DICOM::Element.new(ROI_INTERPRETER, @interpreter))
return item
end | ruby | def ref_beam_item
item = DICOM::Item.new
item.add(DICOM::Element.new(OBS_NUMBER, @number.to_s))
item.add(DICOM::Element.new(REF_ROI_NUMBER, @number.to_s))
item.add(DICOM::Element.new(ROI_TYPE, @type))
item.add(DICOM::Element.new(ROI_INTERPRETER, @interpreter))
return item
end | [
"def",
"ref_beam_item",
"item",
"=",
"DICOM",
"::",
"Item",
".",
"new",
"item",
".",
"add",
"(",
"DICOM",
"::",
"Element",
".",
"new",
"(",
"OBS_NUMBER",
",",
"@number",
".",
"to_s",
")",
")",
"item",
".",
"add",
"(",
"DICOM",
"::",
"Element",
".",
... | Creates a Referenced Beam Sequence Item from the attributes of the Beam instance.
@return [DICOM::Item] a referenced beam sequence item | [
"Creates",
"a",
"Referenced",
"Beam",
"Sequence",
"Item",
"from",
"the",
"attributes",
"of",
"the",
"Beam",
"instance",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/beam.rb#L339-L346 |
22,972 | dicom/rtkit | lib/rtkit/mixins/image_parent.rb | RTKIT.ImageParent.to_voxel_space | def to_voxel_space
raise "This image series has no associated images. Unable to create a VoxelSpace." unless @images.length > 0
img = @images.first
# Create the voxel space:
vs = VoxelSpace.create(img.columns, img.rows, @images.length, img.col_spacing, img.row_spacing, slice_spacing, Coordinate.... | ruby | def to_voxel_space
raise "This image series has no associated images. Unable to create a VoxelSpace." unless @images.length > 0
img = @images.first
# Create the voxel space:
vs = VoxelSpace.create(img.columns, img.rows, @images.length, img.col_spacing, img.row_spacing, slice_spacing, Coordinate.... | [
"def",
"to_voxel_space",
"raise",
"\"This image series has no associated images. Unable to create a VoxelSpace.\"",
"unless",
"@images",
".",
"length",
">",
"0",
"img",
"=",
"@images",
".",
"first",
"# Create the voxel space:",
"vs",
"=",
"VoxelSpace",
".",
"create",
"(",
... | Creates a VoxelSpace instance from the image instances belonging
to this image series.
@return [VoxelSpace] the created VoxelSpace instance | [
"Creates",
"a",
"VoxelSpace",
"instance",
"from",
"the",
"image",
"instances",
"belonging",
"to",
"this",
"image",
"series",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/mixins/image_parent.rb#L36-L46 |
22,973 | dicom/rtkit | lib/rtkit/mixins/image_parent.rb | RTKIT.ImageParent.update_image_position | def update_image_position(image, new_pos)
raise ArgumentError, "Invalid argument 'image'. Expected Image, got #{image.class}." unless image.is_a?(Image)
# Remove old position key:
@image_positions.delete(image.pos_slice)
# Add the new position:
@image_positions[new_pos] = image
end | ruby | def update_image_position(image, new_pos)
raise ArgumentError, "Invalid argument 'image'. Expected Image, got #{image.class}." unless image.is_a?(Image)
# Remove old position key:
@image_positions.delete(image.pos_slice)
# Add the new position:
@image_positions[new_pos] = image
end | [
"def",
"update_image_position",
"(",
"image",
",",
"new_pos",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'image'. Expected Image, got #{image.class}.\"",
"unless",
"image",
".",
"is_a?",
"(",
"Image",
")",
"# Remove old position key:",
"@image_positions",
".",
... | Updates the position that is registered for the image instance for this series.
@param [Image] image an instance belonging to this image series
@param [Float] new_pos a new slice position to be associated with the image instance | [
"Updates",
"the",
"position",
"that",
"is",
"registered",
"for",
"the",
"image",
"instance",
"for",
"this",
"series",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/mixins/image_parent.rb#L53-L59 |
22,974 | dicom/rtkit | lib/rtkit/structure_set.rb | RTKIT.StructureSet.add_plan | def add_plan(plan)
raise ArgumentError, "Invalid argument 'plan'. Expected Plan, got #{plan.class}." unless plan.is_a?(Plan)
@plans << plan unless @associated_plans[plan.uid]
@associated_plans[plan.uid] = plan
end | ruby | def add_plan(plan)
raise ArgumentError, "Invalid argument 'plan'. Expected Plan, got #{plan.class}." unless plan.is_a?(Plan)
@plans << plan unless @associated_plans[plan.uid]
@associated_plans[plan.uid] = plan
end | [
"def",
"add_plan",
"(",
"plan",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'plan'. Expected Plan, got #{plan.class}.\"",
"unless",
"plan",
".",
"is_a?",
"(",
"Plan",
")",
"@plans",
"<<",
"plan",
"unless",
"@associated_plans",
"[",
"plan",
".",
"uid",
"]... | Adds a Plan Series to this StructureSet.
@param [Plan] plan a plan instance to be associated with this structure set | [
"Adds",
"a",
"Plan",
"Series",
"to",
"this",
"StructureSet",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/structure_set.rb#L152-L156 |
22,975 | dicom/rtkit | lib/rtkit/structure_set.rb | RTKIT.StructureSet.add_poi | def add_poi(poi)
raise ArgumentError, "Invalid argument 'poi'. Expected POI, got #{poi.class}." unless poi.is_a?(POI)
@structures << poi unless @structures.include?(poi)
end | ruby | def add_poi(poi)
raise ArgumentError, "Invalid argument 'poi'. Expected POI, got #{poi.class}." unless poi.is_a?(POI)
@structures << poi unless @structures.include?(poi)
end | [
"def",
"add_poi",
"(",
"poi",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'poi'. Expected POI, got #{poi.class}.\"",
"unless",
"poi",
".",
"is_a?",
"(",
"POI",
")",
"@structures",
"<<",
"poi",
"unless",
"@structures",
".",
"include?",
"(",
"poi",
")",
... | Adds a POI instance to this StructureSet.
@param [POI] poi a poi instance to be associated with this structure set | [
"Adds",
"a",
"POI",
"instance",
"to",
"this",
"StructureSet",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/structure_set.rb#L162-L165 |
22,976 | dicom/rtkit | lib/rtkit/structure_set.rb | RTKIT.StructureSet.add_structure | def add_structure(structure)
raise ArgumentError, "Invalid argument 'structure'. Expected ROI/POI, got #{structure.class}." unless structure.respond_to?(:to_roi) or structure.respond_to?(:to_poi)
@structures << structure unless @structures.include?(structure)
end | ruby | def add_structure(structure)
raise ArgumentError, "Invalid argument 'structure'. Expected ROI/POI, got #{structure.class}." unless structure.respond_to?(:to_roi) or structure.respond_to?(:to_poi)
@structures << structure unless @structures.include?(structure)
end | [
"def",
"add_structure",
"(",
"structure",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'structure'. Expected ROI/POI, got #{structure.class}.\"",
"unless",
"structure",
".",
"respond_to?",
"(",
":to_roi",
")",
"or",
"structure",
".",
"respond_to?",
"(",
":to_poi"... | Adds a Structure instance to this StructureSet.
@param [ROI, POI] structure a Structure to be associated with this StructureSet | [
"Adds",
"a",
"Structure",
"instance",
"to",
"this",
"StructureSet",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/structure_set.rb#L171-L174 |
22,977 | dicom/rtkit | lib/rtkit/structure_set.rb | RTKIT.StructureSet.add_roi | def add_roi(roi)
raise ArgumentError, "Invalid argument 'roi'. Expected ROI, got #{roi.class}." unless roi.is_a?(ROI)
@structures << roi unless @structures.include?(roi)
end | ruby | def add_roi(roi)
raise ArgumentError, "Invalid argument 'roi'. Expected ROI, got #{roi.class}." unless roi.is_a?(ROI)
@structures << roi unless @structures.include?(roi)
end | [
"def",
"add_roi",
"(",
"roi",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'roi'. Expected ROI, got #{roi.class}.\"",
"unless",
"roi",
".",
"is_a?",
"(",
"ROI",
")",
"@structures",
"<<",
"roi",
"unless",
"@structures",
".",
"include?",
"(",
"roi",
")",
... | Adds a ROI instance to this StructureSet.
@param [ROI] roi a roi instance to be associated with this structure set | [
"Adds",
"a",
"ROI",
"instance",
"to",
"this",
"StructureSet",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/structure_set.rb#L180-L183 |
22,978 | dicom/rtkit | lib/rtkit/structure_set.rb | RTKIT.StructureSet.create_roi | def create_roi(frame, options={})
raise ArgumentError, "Expected Frame, got #{frame.class}." unless frame.is_a?(Frame)
# Set values:
algorithm = options[:algorithm] || 'Automatic'
name = options[:name] || 'RTKIT-VOLUME'
interpreter = options[:interpreter] || 'RTKIT'
type = options[:t... | ruby | def create_roi(frame, options={})
raise ArgumentError, "Expected Frame, got #{frame.class}." unless frame.is_a?(Frame)
# Set values:
algorithm = options[:algorithm] || 'Automatic'
name = options[:name] || 'RTKIT-VOLUME'
interpreter = options[:interpreter] || 'RTKIT'
type = options[:t... | [
"def",
"create_roi",
"(",
"frame",
",",
"options",
"=",
"{",
"}",
")",
"raise",
"ArgumentError",
",",
"\"Expected Frame, got #{frame.class}.\"",
"unless",
"frame",
".",
"is_a?",
"(",
"Frame",
")",
"# Set values:",
"algorithm",
"=",
"options",
"[",
":algorithm",
... | Creates a ROI belonging to this StructureSet.
@note The ROI is created without any Slice instances (these must be added
after the ROI creation).
@param [Frame] frame the Frame which the ROI is to be associated with
@param [Hash] options the options to use for creating the ROI
@option options [String] :algorithm ... | [
"Creates",
"a",
"ROI",
"belonging",
"to",
"this",
"StructureSet",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/structure_set.rb#L198-L215 |
22,979 | dicom/rtkit | lib/rtkit/structure_set.rb | RTKIT.StructureSet.remove_structure | def remove_structure(instance_or_number)
raise ArgumentError, "Invalid argument 'instance_or_number'. Expected a ROI Instance or an Integer (ROI Number). Got #{instance_or_number.class}." unless [ROI, Integer].include?(instance_or_number.class)
s_instance = instance_or_number
if instance_or_number.is_... | ruby | def remove_structure(instance_or_number)
raise ArgumentError, "Invalid argument 'instance_or_number'. Expected a ROI Instance or an Integer (ROI Number). Got #{instance_or_number.class}." unless [ROI, Integer].include?(instance_or_number.class)
s_instance = instance_or_number
if instance_or_number.is_... | [
"def",
"remove_structure",
"(",
"instance_or_number",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'instance_or_number'. Expected a ROI Instance or an Integer (ROI Number). Got #{instance_or_number.class}.\"",
"unless",
"[",
"ROI",
",",
"Integer",
"]",
".",
"include?",
"... | Removes a ROI or POI from the structure set.
@param [ROI, POI, Integer] instance_or_number the ROI/POI instance or its identifying number | [
"Removes",
"a",
"ROI",
"or",
"POI",
"from",
"the",
"structure",
"set",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/structure_set.rb#L268-L279 |
22,980 | dicom/rtkit | lib/rtkit/structure_set.rb | RTKIT.StructureSet.structure_names | def structure_names
names = Array.new
@structures.each do |s|
names << s.name
end
return names
end | ruby | def structure_names
names = Array.new
@structures.each do |s|
names << s.name
end
return names
end | [
"def",
"structure_names",
"names",
"=",
"Array",
".",
"new",
"@structures",
".",
"each",
"do",
"|",
"s",
"|",
"names",
"<<",
"s",
".",
"name",
"end",
"return",
"names",
"end"
] | Gives the names of the structure set's associated structures.
@return [Array<String>] the names of the associated structures | [
"Gives",
"the",
"names",
"of",
"the",
"structure",
"set",
"s",
"associated",
"structures",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/structure_set.rb#L321-L327 |
22,981 | dicom/rtkit | lib/rtkit/structure_set.rb | RTKIT.StructureSet.structure_numbers | def structure_numbers
numbers = Array.new
@structures.each do |s|
numbers << s.number
end
return numbers
end | ruby | def structure_numbers
numbers = Array.new
@structures.each do |s|
numbers << s.number
end
return numbers
end | [
"def",
"structure_numbers",
"numbers",
"=",
"Array",
".",
"new",
"@structures",
".",
"each",
"do",
"|",
"s",
"|",
"numbers",
"<<",
"s",
".",
"number",
"end",
"return",
"numbers",
"end"
] | Gives the numbers of the structure set's associated structures.
@return [Array<Integer>] the numbers of the associated structures | [
"Gives",
"the",
"numbers",
"of",
"the",
"structure",
"set",
"s",
"associated",
"structures",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/structure_set.rb#L333-L339 |
22,982 | dicom/rtkit | lib/rtkit/structure_set.rb | RTKIT.StructureSet.to_dcm | def to_dcm
# Use the original DICOM object as a starting point (keeping all non-sequence elements):
#@dcm[REF_FRAME_OF_REF_SQ].delete_children
@dcm[STRUCTURE_SET_ROI_SQ].delete_children
@dcm[ROI_CONTOUR_SQ].delete_children
@dcm[RT_ROI_OBS_SQ].delete_children
# Create DICOM
@roi... | ruby | def to_dcm
# Use the original DICOM object as a starting point (keeping all non-sequence elements):
#@dcm[REF_FRAME_OF_REF_SQ].delete_children
@dcm[STRUCTURE_SET_ROI_SQ].delete_children
@dcm[ROI_CONTOUR_SQ].delete_children
@dcm[RT_ROI_OBS_SQ].delete_children
# Create DICOM
@roi... | [
"def",
"to_dcm",
"# Use the original DICOM object as a starting point (keeping all non-sequence elements):",
"#@dcm[REF_FRAME_OF_REF_SQ].delete_children",
"@dcm",
"[",
"STRUCTURE_SET_ROI_SQ",
"]",
".",
"delete_children",
"@dcm",
"[",
"ROI_CONTOUR_SQ",
"]",
".",
"delete_children",
"@d... | Converts the structure set instance to a DICOM object.
@note This method uses the original DICOM object of the structure set,
and updates it with attributes from the structure set instance.
@return [DICOM::DObject] the processed DICOM object | [
"Converts",
"the",
"structure",
"set",
"instance",
"to",
"a",
"DICOM",
"object",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/structure_set.rb#L390-L403 |
22,983 | dicom/rtkit | lib/rtkit/structure_set.rb | RTKIT.StructureSet.load_structures | def load_structures
if @dcm[STRUCTURE_SET_ROI_SQ] && @dcm[ROI_CONTOUR_SQ] && @dcm[RT_ROI_OBS_SQ]
# Load the information in a nested hash:
item_group = Hash.new
@dcm[STRUCTURE_SET_ROI_SQ].each do |roi_item|
item_group[roi_item.value(ROI_NUMBER)] = {:roi => roi_item}
end
... | ruby | def load_structures
if @dcm[STRUCTURE_SET_ROI_SQ] && @dcm[ROI_CONTOUR_SQ] && @dcm[RT_ROI_OBS_SQ]
# Load the information in a nested hash:
item_group = Hash.new
@dcm[STRUCTURE_SET_ROI_SQ].each do |roi_item|
item_group[roi_item.value(ROI_NUMBER)] = {:roi => roi_item}
end
... | [
"def",
"load_structures",
"if",
"@dcm",
"[",
"STRUCTURE_SET_ROI_SQ",
"]",
"&&",
"@dcm",
"[",
"ROI_CONTOUR_SQ",
"]",
"&&",
"@dcm",
"[",
"RT_ROI_OBS_SQ",
"]",
"# Load the information in a nested hash:",
"item_group",
"=",
"Hash",
".",
"new",
"@dcm",
"[",
"STRUCTURE_SE... | Loads the ROI Items contained in the structure set and creates ROI
and POI instances, which are referenced to this structure set. | [
"Loads",
"the",
"ROI",
"Items",
"contained",
"in",
"the",
"structure",
"set",
"and",
"creates",
"ROI",
"and",
"POI",
"instances",
"which",
"are",
"referenced",
"to",
"this",
"structure",
"set",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/structure_set.rb#L475-L495 |
22,984 | dicom/rtkit | lib/rtkit/frame.rb | RTKIT.Frame.add_image | def add_image(image)
raise ArgumentError, "Invalid argument 'image'. Expected Image, got #{image.class}." unless image.is_a?(Image)
@associated_instance_uids[image.uid] = image
# If the ImageSeries of an added Image is not connected to this Frame yet, do so:
add_series(image.series) unless serie... | ruby | def add_image(image)
raise ArgumentError, "Invalid argument 'image'. Expected Image, got #{image.class}." unless image.is_a?(Image)
@associated_instance_uids[image.uid] = image
# If the ImageSeries of an added Image is not connected to this Frame yet, do so:
add_series(image.series) unless serie... | [
"def",
"add_image",
"(",
"image",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'image'. Expected Image, got #{image.class}.\"",
"unless",
"image",
".",
"is_a?",
"(",
"Image",
")",
"@associated_instance_uids",
"[",
"image",
".",
"uid",
"]",
"=",
"image",
"# ... | Adds an Image to this Frame.
@param [Image] image an image instance to be associated with this frame | [
"Adds",
"an",
"Image",
"to",
"this",
"Frame",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/frame.rb#L67-L72 |
22,985 | dicom/rtkit | lib/rtkit/frame.rb | RTKIT.Frame.add_series | def add_series(series)
raise ArgumentError, "Invalid argument 'series' Expected ImageSeries or DoseVolume, got #{series.class}." unless [ImageSeries, DoseVolume].include?(series.class)
@image_series << series
@associated_series[series.uid] = series
end | ruby | def add_series(series)
raise ArgumentError, "Invalid argument 'series' Expected ImageSeries or DoseVolume, got #{series.class}." unless [ImageSeries, DoseVolume].include?(series.class)
@image_series << series
@associated_series[series.uid] = series
end | [
"def",
"add_series",
"(",
"series",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'series' Expected ImageSeries or DoseVolume, got #{series.class}.\"",
"unless",
"[",
"ImageSeries",
",",
"DoseVolume",
"]",
".",
"include?",
"(",
"series",
".",
"class",
")",
"@ima... | Adds an ImageSeries to this Frame.
@param [ImageSeries, DoseVolume] series an image series instance to be associated with this frame | [
"Adds",
"an",
"ImageSeries",
"to",
"this",
"Frame",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/frame.rb#L87-L91 |
22,986 | dicom/rtkit | lib/rtkit/contour.rb | RTKIT.Contour.add_coordinate | def add_coordinate(coordinate)
raise ArgumentError, "Invalid argument 'coordinate'. Expected Coordinate, got #{coordinate.class}." unless coordinate.is_a?(Coordinate)
@coordinates << coordinate unless @coordinates.include?(coordinate)
end | ruby | def add_coordinate(coordinate)
raise ArgumentError, "Invalid argument 'coordinate'. Expected Coordinate, got #{coordinate.class}." unless coordinate.is_a?(Coordinate)
@coordinates << coordinate unless @coordinates.include?(coordinate)
end | [
"def",
"add_coordinate",
"(",
"coordinate",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'coordinate'. Expected Coordinate, got #{coordinate.class}.\"",
"unless",
"coordinate",
".",
"is_a?",
"(",
"Coordinate",
")",
"@coordinates",
"<<",
"coordinate",
"unless",
"@co... | Adds a Coordinate instance to this Contour.
@param [Coordinate] coordinate a coordinate instance to be associated with this contour | [
"Adds",
"a",
"Coordinate",
"instance",
"to",
"this",
"Contour",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/contour.rb#L114-L117 |
22,987 | dicom/rtkit | lib/rtkit/contour.rb | RTKIT.Contour.coords | def coords
x, y, z = Array.new, Array.new, Array.new
@coordinates.each do |coord|
x << coord.x
y << coord.y
z << coord.z
end
return x, y, z
end | ruby | def coords
x, y, z = Array.new, Array.new, Array.new
@coordinates.each do |coord|
x << coord.x
y << coord.y
z << coord.z
end
return x, y, z
end | [
"def",
"coords",
"x",
",",
"y",
",",
"z",
"=",
"Array",
".",
"new",
",",
"Array",
".",
"new",
",",
"Array",
".",
"new",
"@coordinates",
".",
"each",
"do",
"|",
"coord",
"|",
"x",
"<<",
"coord",
".",
"x",
"y",
"<<",
"coord",
".",
"y",
"z",
"<<... | Extracts and transposes all coordinates of this contour, such that the
coordinates are given in arrays of x, y and z coordinates.
@return [Array] the coordinates of this contour, converted to x, y and z arrays | [
"Extracts",
"and",
"transposes",
"all",
"coordinates",
"of",
"this",
"contour",
"such",
"that",
"the",
"coordinates",
"are",
"given",
"in",
"arrays",
"of",
"x",
"y",
"and",
"z",
"coordinates",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/contour.rb#L134-L142 |
22,988 | dicom/rtkit | lib/rtkit/contour.rb | RTKIT.Contour.create_coordinates | def create_coordinates(contour_data)
raise ArgumentError, "Invalid argument 'contour_data'. Expected String (or nil), got #{contour_data.class}." unless [String, NilClass].include?(contour_data.class)
if contour_data && contour_data != ""
# Split the number strings, sperated by a '\', into an array:... | ruby | def create_coordinates(contour_data)
raise ArgumentError, "Invalid argument 'contour_data'. Expected String (or nil), got #{contour_data.class}." unless [String, NilClass].include?(contour_data.class)
if contour_data && contour_data != ""
# Split the number strings, sperated by a '\', into an array:... | [
"def",
"create_coordinates",
"(",
"contour_data",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'contour_data'. Expected String (or nil), got #{contour_data.class}.\"",
"unless",
"[",
"String",
",",
"NilClass",
"]",
".",
"include?",
"(",
"contour_data",
".",
"class"... | Creates and connects Coordinate instances with this Contour instance
by processing the value of the Contour Data element value.
@param [String, NilClass] contour_data a string containing x,y,z coordinate triplets separated by '\' | [
"Creates",
"and",
"connects",
"Coordinate",
"instances",
"with",
"this",
"Contour",
"instance",
"by",
"processing",
"the",
"value",
"of",
"the",
"Contour",
"Data",
"element",
"value",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/contour.rb#L149-L163 |
22,989 | dicom/rtkit | lib/rtkit/contour.rb | RTKIT.Contour.to_item | def to_item
# FIXME: We need to decide on how to principally handle the situation when an image series has not been
# loaded, and how to set up the ROI slices. A possible solution is to create Image instances if they hasn't been loaded.
item = DICOM::Item.new
item.add(DICOM::Sequence.new(CONTOUR... | ruby | def to_item
# FIXME: We need to decide on how to principally handle the situation when an image series has not been
# loaded, and how to set up the ROI slices. A possible solution is to create Image instances if they hasn't been loaded.
item = DICOM::Item.new
item.add(DICOM::Sequence.new(CONTOUR... | [
"def",
"to_item",
"# FIXME: We need to decide on how to principally handle the situation when an image series has not been",
"# loaded, and how to set up the ROI slices. A possible solution is to create Image instances if they hasn't been loaded.",
"item",
"=",
"DICOM",
"::",
"Item",
".",
"new",... | Creates a Contour Sequence Item from the attributes of the Contour.
@return [DICOM::Item] the created DICOM item | [
"Creates",
"a",
"Contour",
"Sequence",
"Item",
"from",
"the",
"attributes",
"of",
"the",
"Contour",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/contour.rb#L187-L200 |
22,990 | dicom/rtkit | lib/rtkit/contour.rb | RTKIT.Contour.translate | def translate(x, y, z)
@coordinates.each do |c|
c.translate(x, y, z)
end
end | ruby | def translate(x, y, z)
@coordinates.each do |c|
c.translate(x, y, z)
end
end | [
"def",
"translate",
"(",
"x",
",",
"y",
",",
"z",
")",
"@coordinates",
".",
"each",
"do",
"|",
"c",
"|",
"c",
".",
"translate",
"(",
"x",
",",
"y",
",",
"z",
")",
"end",
"end"
] | Moves the coordinates of this contour according to the given offset
vector.
@param [Float] x the offset along the x axis (in units of mm)
@param [Float] y the offset along the y axis (in units of mm)
@param [Float] z the offset along the z axis (in units of mm) | [
"Moves",
"the",
"coordinates",
"of",
"this",
"contour",
"according",
"to",
"the",
"given",
"offset",
"vector",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/contour.rb#L209-L213 |
22,991 | celluloid/dcell | lib/dcell/server.rb | DCell.MessageHandler.handle_message | def handle_message(message)
begin
message = decode_message message
rescue InvalidMessageError => ex
Logger.crash("couldn't decode message", ex)
return
end
begin
message.dispatch
rescue => ex
Logger.crash("message dispatch failed", ex)
end
... | ruby | def handle_message(message)
begin
message = decode_message message
rescue InvalidMessageError => ex
Logger.crash("couldn't decode message", ex)
return
end
begin
message.dispatch
rescue => ex
Logger.crash("message dispatch failed", ex)
end
... | [
"def",
"handle_message",
"(",
"message",
")",
"begin",
"message",
"=",
"decode_message",
"message",
"rescue",
"InvalidMessageError",
"=>",
"ex",
"Logger",
".",
"crash",
"(",
"\"couldn't decode message\"",
",",
"ex",
")",
"return",
"end",
"begin",
"message",
".",
... | Handle incoming messages | [
"Handle",
"incoming",
"messages"
] | a8fecfae220cb2c20d3761bc27880e4133aba498 | https://github.com/celluloid/dcell/blob/a8fecfae220cb2c20d3761bc27880e4133aba498/lib/dcell/server.rb#L8-L21 |
22,992 | celluloid/dcell | lib/dcell/server.rb | DCell.MessageHandler.decode_message | def decode_message(message)
begin
msg = MessagePack.unpack(message, symbolize_keys: true)
rescue => ex
raise InvalidMessageError, "couldn't unpack message: #{ex}"
end
begin
klass = Utils.full_const_get msg[:type]
o = klass.new(*msg[:args])
o.id = msg[:id] ... | ruby | def decode_message(message)
begin
msg = MessagePack.unpack(message, symbolize_keys: true)
rescue => ex
raise InvalidMessageError, "couldn't unpack message: #{ex}"
end
begin
klass = Utils.full_const_get msg[:type]
o = klass.new(*msg[:args])
o.id = msg[:id] ... | [
"def",
"decode_message",
"(",
"message",
")",
"begin",
"msg",
"=",
"MessagePack",
".",
"unpack",
"(",
"message",
",",
"symbolize_keys",
":",
"true",
")",
"rescue",
"=>",
"ex",
"raise",
"InvalidMessageError",
",",
"\"couldn't unpack message: #{ex}\"",
"end",
"begin... | Decode incoming messages | [
"Decode",
"incoming",
"messages"
] | a8fecfae220cb2c20d3761bc27880e4133aba498 | https://github.com/celluloid/dcell/blob/a8fecfae220cb2c20d3761bc27880e4133aba498/lib/dcell/server.rb#L24-L38 |
22,993 | celluloid/dcell | lib/dcell/server.rb | DCell.Server.run | def run
while true
message = @socket.read_multipart
if @socket.is_a? Celluloid::ZMQ::RouterSocket
message = message[1]
else
message = message[0]
end
handle_message message
end
end | ruby | def run
while true
message = @socket.read_multipart
if @socket.is_a? Celluloid::ZMQ::RouterSocket
message = message[1]
else
message = message[0]
end
handle_message message
end
end | [
"def",
"run",
"while",
"true",
"message",
"=",
"@socket",
".",
"read_multipart",
"if",
"@socket",
".",
"is_a?",
"Celluloid",
"::",
"ZMQ",
"::",
"RouterSocket",
"message",
"=",
"message",
"[",
"1",
"]",
"else",
"message",
"=",
"message",
"[",
"0",
"]",
"e... | Wait for incoming 0MQ messages | [
"Wait",
"for",
"incoming",
"0MQ",
"messages"
] | a8fecfae220cb2c20d3761bc27880e4133aba498 | https://github.com/celluloid/dcell/blob/a8fecfae220cb2c20d3761bc27880e4133aba498/lib/dcell/server.rb#L80-L90 |
22,994 | jlong/radius | lib/radius/parser/scanner.rb | Radius.Scanner.operate | def operate(prefix, data)
data = Radius::OrdString.new data
@nodes = ['']
re = scanner_regex(prefix)
if md = re.match(data)
remainder = ''
while md
start_tag, attributes, self_enclosed, end_tag = $1, $2, $3, $4
flavor = self_enclosed == '/' ? :... | ruby | def operate(prefix, data)
data = Radius::OrdString.new data
@nodes = ['']
re = scanner_regex(prefix)
if md = re.match(data)
remainder = ''
while md
start_tag, attributes, self_enclosed, end_tag = $1, $2, $3, $4
flavor = self_enclosed == '/' ? :... | [
"def",
"operate",
"(",
"prefix",
",",
"data",
")",
"data",
"=",
"Radius",
"::",
"OrdString",
".",
"new",
"data",
"@nodes",
"=",
"[",
"''",
"]",
"re",
"=",
"scanner_regex",
"(",
"prefix",
")",
"if",
"md",
"=",
"re",
".",
"match",
"(",
"data",
")",
... | Parses a given string and returns an array of nodes.
The nodes consist of strings and hashes that describe a Radius tag that was found. | [
"Parses",
"a",
"given",
"string",
"and",
"returns",
"an",
"array",
"of",
"nodes",
".",
"The",
"nodes",
"consist",
"of",
"strings",
"and",
"hashes",
"that",
"describe",
"a",
"Radius",
"tag",
"that",
"was",
"found",
"."
] | e7b4eab374c6a15e105524ccd663767b8bc91e5b | https://github.com/jlong/radius/blob/e7b4eab374c6a15e105524ccd663767b8bc91e5b/lib/radius/parser/scanner.rb#L12-L44 |
22,995 | slagyr/limelight | ruby/lib/limelight/theater.rb | Limelight.Theater.add_stage | def add_stage(name, options = {})
stage = build_stage(name, options).proxy
@peer.add(stage.peer)
return stage
end | ruby | def add_stage(name, options = {})
stage = build_stage(name, options).proxy
@peer.add(stage.peer)
return stage
end | [
"def",
"add_stage",
"(",
"name",
",",
"options",
"=",
"{",
"}",
")",
"stage",
"=",
"build_stage",
"(",
"name",
",",
"options",
")",
".",
"proxy",
"@peer",
".",
"add",
"(",
"stage",
".",
"peer",
")",
"return",
"stage",
"end"
] | Adds a Stage to the Theater. Raises an exception is the name of the Stage is duplicated. | [
"Adds",
"a",
"Stage",
"to",
"the",
"Theater",
".",
"Raises",
"an",
"exception",
"is",
"the",
"name",
"of",
"the",
"Stage",
"is",
"duplicated",
"."
] | 2e8db684771587422d55a9329e895481e9b56a26 | https://github.com/slagyr/limelight/blob/2e8db684771587422d55a9329e895481e9b56a26/ruby/lib/limelight/theater.rb#L52-L56 |
22,996 | dicom/rtkit | lib/rtkit/bin_matcher.rb | RTKIT.BinMatcher.fill_blanks | def fill_blanks
if @volumes.length > 0
# Register all unique images referenced by the various volumes:
images = Set.new
# Include the master volume (if it is present):
[@volumes, @master].flatten.compact.each do |volume|
volume.bin_images.each do |bin_image|
i... | ruby | def fill_blanks
if @volumes.length > 0
# Register all unique images referenced by the various volumes:
images = Set.new
# Include the master volume (if it is present):
[@volumes, @master].flatten.compact.each do |volume|
volume.bin_images.each do |bin_image|
i... | [
"def",
"fill_blanks",
"if",
"@volumes",
".",
"length",
">",
"0",
"# Register all unique images referenced by the various volumes:",
"images",
"=",
"Set",
".",
"new",
"# Include the master volume (if it is present):",
"[",
"@volumes",
",",
"@master",
"]",
".",
"flatten",
"... | Ensures that a valid comparison between volumes can be done, by making
sure that every volume has a BinImage for any image that is referenced
among the BinVolumes. If some BinVolumes are missing one or more
BinImages, empty BinImages will be created for these BinVolumes.
@note The master volume (if present) is als... | [
"Ensures",
"that",
"a",
"valid",
"comparison",
"between",
"volumes",
"can",
"be",
"done",
"by",
"making",
"sure",
"that",
"every",
"volume",
"has",
"a",
"BinImage",
"for",
"any",
"image",
"that",
"is",
"referenced",
"among",
"the",
"BinVolumes",
".",
"If",
... | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/bin_matcher.rb#L79-L104 |
22,997 | dicom/rtkit | lib/rtkit/dose_volume.rb | RTKIT.DoseVolume.add_image | def add_image(image)
raise ArgumentError, "Invalid argument 'image'. Expected Image, got #{image.class}." unless image.is_a?(Image)
@images << image unless @associated_images[image.uid]
@associated_images[image.uid] = image
@image_positions[image.pos_slice.round(2)] = image
end | ruby | def add_image(image)
raise ArgumentError, "Invalid argument 'image'. Expected Image, got #{image.class}." unless image.is_a?(Image)
@images << image unless @associated_images[image.uid]
@associated_images[image.uid] = image
@image_positions[image.pos_slice.round(2)] = image
end | [
"def",
"add_image",
"(",
"image",
")",
"raise",
"ArgumentError",
",",
"\"Invalid argument 'image'. Expected Image, got #{image.class}.\"",
"unless",
"image",
".",
"is_a?",
"(",
"Image",
")",
"@images",
"<<",
"image",
"unless",
"@associated_images",
"[",
"image",
".",
... | Adds an Image to this Volume.
@param [Image] image an image instance to be associated with this dose volume | [
"Adds",
"an",
"Image",
"to",
"this",
"Volume",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/dose_volume.rb#L138-L143 |
22,998 | dicom/rtkit | lib/rtkit/dose_volume.rb | RTKIT.DoseVolume.image_by_slice_pos | def image_by_slice_pos(pos)
# Step 1: Try for an (exact) match:
image = @image_positions[pos.round(2)]
# Step 2: If no match, try to search for a close match:
# (A close match is defined as the given slice position being within 1/3 of the
# slice distance from an existing image instance in... | ruby | def image_by_slice_pos(pos)
# Step 1: Try for an (exact) match:
image = @image_positions[pos.round(2)]
# Step 2: If no match, try to search for a close match:
# (A close match is defined as the given slice position being within 1/3 of the
# slice distance from an existing image instance in... | [
"def",
"image_by_slice_pos",
"(",
"pos",
")",
"# Step 1: Try for an (exact) match:",
"image",
"=",
"@image_positions",
"[",
"pos",
".",
"round",
"(",
"2",
")",
"]",
"# Step 2: If no match, try to search for a close match:",
"# (A close match is defined as the given slice position... | Returns an image instance matched by the given slice position.
@param [Float] pos image slice position
@return [Image, NilClass] the matched image (or nil if no image is matched) | [
"Returns",
"an",
"image",
"instance",
"matched",
"by",
"the",
"given",
"slice",
"position",
"."
] | 08248bf294769ae5b45ed4a9671f0620d5740252 | https://github.com/dicom/rtkit/blob/08248bf294769ae5b45ed4a9671f0620d5740252/lib/rtkit/dose_volume.rb#L288-L302 |
22,999 | dradis/dradis-plugins | lib/dradis/plugins/settings.rb | Dradis::Plugins.Settings.dirty_or_db_setting_or_default | def dirty_or_db_setting_or_default(key)
if @dirty_options.key?(key)
@dirty_options[key]
elsif Configuration.exists?(name: namespaced_key(key))
db_setting(key)
else
@default_options[key]
end
end | ruby | def dirty_or_db_setting_or_default(key)
if @dirty_options.key?(key)
@dirty_options[key]
elsif Configuration.exists?(name: namespaced_key(key))
db_setting(key)
else
@default_options[key]
end
end | [
"def",
"dirty_or_db_setting_or_default",
"(",
"key",
")",
"if",
"@dirty_options",
".",
"key?",
"(",
"key",
")",
"@dirty_options",
"[",
"key",
"]",
"elsif",
"Configuration",
".",
"exists?",
"(",
"name",
":",
"namespaced_key",
"(",
"key",
")",
")",
"db_setting",... | This method looks up in the configuration repository DB to see if the
user has provided a value for the given setting. If not, the default
value is returned. | [
"This",
"method",
"looks",
"up",
"in",
"the",
"configuration",
"repository",
"DB",
"to",
"see",
"if",
"the",
"user",
"has",
"provided",
"a",
"value",
"for",
"the",
"given",
"setting",
".",
"If",
"not",
"the",
"default",
"value",
"is",
"returned",
"."
] | 570367ba16e42dae3f3065a6b72c544dd780ca36 | https://github.com/dradis/dradis-plugins/blob/570367ba16e42dae3f3065a6b72c544dd780ca36/lib/dradis/plugins/settings.rb#L76-L84 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.