   # cached object image content data is not loaded until the image
   # object load() function is called.
   #
-  # @param parent the ImageContainer scan or registration object
+  # @param parent the Scan or Registration object
   # @returns the image objects
   imagesFor: (parent) ->
     cache(parent) or cache(parent, parent.files...)

        # @returns the number of decimals to display for the
        #   given value
        defaultValuePrecision = (value) ->
          if value == 0 or value > 1
            0
          else
            1 + defaultValuePrecision(value * 10)

svcs = angular.module 'qiprofile.services', ['ngResource']

svcs.factory 'Subject', ['$q', '$resource', ($q, $resource) ->
  # The Subject resource recognizes a 'get' query method on the
  # subject id, but qiprofile does not call this in practice.
  # Fetching a Subject is done by a query on the subject project,
  # collection and number, which returns a singleton or empty
  # array.
  $resource '/api/subjects/:id', null,
    query:
      method: 'GET'
      isArray: true
      transformResponse: (data) -> angular.fromJson(data)._items
    detail:
      method: 'GET'
      url: '/api/subject-detail/:id/'
